上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页
  2012年12月1日
摘要: 常用的常量配置 struts.serve.static.browserCache 该属性设置浏览器是否缓存静态内容。当应用处于开发阶段时,我们希望每次请求都获得服务器的最新响应,则可设置该属性为false。 struts.enable.DynamicMethodInvocation 该属性设置Struts 2是否支持动态方法调用,该属性的默认值是true。如果需要关闭动态方法调用,则可设置该属性为false。 struts.enable.SlashesInActionNames 该属性设置Struts 2是否允许在Action名中使用斜线,该属性的默认值是false。如果开发者希望允许在Act 阅读全文
posted @ 2012-12-01 18:51 elleniou 阅读(1801) 评论(0) 推荐(0) 编辑
  2012年10月24日
摘要: 1 --1、查找员工的编号、姓名、部门和出生日期,如果出生日期为空值,显示日期不详,并按部门排序输出,日期格式为yyyy-mm-dd。 2 select emp_no,emp_name,dept,isnull(convert(char(10),birthday,120),'日期不详') birthday 3 from employee 4 order by dept 5 6 --2、查找与喻自强在同一个单位的员工姓名、性别、部门和职称 7 select emp_no,emp_name,dept,title 8 from employee 9 where emp_name< 阅读全文
posted @ 2012-10-24 10:51 elleniou 阅读(43582) 评论(15) 推荐(4) 编辑
  2012年10月20日
摘要: 当使用type=“redirectAction” 或type=“redirect”提交到一个action并且需要传递一个参数时。这里是有区别的:使用type=“redirectAction”时,结果就只能写Action的配置名,不能带有后缀:“.action”Java代码 <action name="Login" class="steven.actions.LoginAction"> <result name="success" type="redirectAction">User?u_id 阅读全文
posted @ 2012-10-20 14:06 elleniou 阅读(6451) 评论(0) 推荐(0) 编辑
  2012年10月17日
摘要: 配置文件 1 <?xml version="1.0" encoding="UTF-8" ?> 2 <!DOCTYPE struts PUBLIC 3 "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" 4 "http://struts.apache.org/dtds/struts-2.0.dtd"> 5 6 <struts> 7 <constant name="struts.devMo 阅读全文
posted @ 2012-10-17 21:41 elleniou 阅读(1907) 评论(0) 推荐(0) 编辑
摘要: 1 <struts> 2 <constant name="struts.devMode" value="true" /> 3 <package name="user" namespace="/user" extends="struts-default"> 4 5 <!-- 在这个package里可以共用的结果集,每个action中都可以使用这个result --> 6 <global-results> 7 <result name 阅读全文
posted @ 2012-10-17 19:07 elleniou 阅读(13053) 评论(1) 推荐(0) 编辑
摘要: Struts2 result类型1.dispatcher:服务器跳转到页面,通常来处理JSP,默认类型。2.redirect:重定向到页面。Action:1 public String redirect() { 2 message = "message中有值"; 3 return "redirect"; 4 } struts.xml1 <package name="chapter3" namespace="/chapter3" extends="struts-default"> 2 阅读全文
posted @ 2012-10-17 18:52 elleniou 阅读(3144) 评论(0) 推荐(0) 编辑
  2012年10月16日
摘要: 1 <?xml version="1.0" encoding="UTF-8" ?> 2 <!DOCTYPE struts PUBLIC 3 "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" 4 "http://struts.apache.org/dtds/struts-2.0.dtd"> 5 6 <struts> 7 <constant name="struts.devMode&qu 阅读全文
posted @ 2012-10-16 19:22 elleniou 阅读(204) 评论(0) 推荐(0) 编辑
  2012年10月15日
摘要: 1 <?xml version="1.0" encoding="UTF-8" ?> 2 <!DOCTYPE struts PUBLIC 3 "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" 4 "http://struts.apache.org/dtds/struts-2.0.dtd"> 5 6 <struts> 7 <constant name="struts.devMode&qu 阅读全文
posted @ 2012-10-15 16:48 elleniou 阅读(176) 评论(0) 推荐(0) 编辑
摘要: //index.jsp 1 <?xml version="1.0" encoding="GB18030" ?> 2 <%@ page language="java" contentType="text/html; charset=GB18030" 3 pageEncoding="GB18030"%> 4 5 <% String context = request.getContextPath(); %> 6 7 <!DOCTYPE html PUBLIC 阅读全文
posted @ 2012-10-15 16:21 elleniou 阅读(533) 评论(0) 推荐(0) 编辑
摘要: 1 namespace决定了action的访问路径,默认为"",可以接收所有路径的action2 namespace可以写为/,或者/xxx,或者/xxx/yyy,对应的action访问路径为/index.action,3 /xxx/index.action,或者/xxx/yyy/index.action.4 namespace最好也用模块来进行命名 1 <?xml version="1.0" encoding="UTF-8" ?> 2 <!DOCTYPE struts PUBLIC 3 "-//Apach 阅读全文
posted @ 2012-10-15 15:19 elleniou 阅读(1810) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页