摘要: 1.访问或添加request/session/application属性publicString scope() throws Exception{ ActionContext ctx =ActionContext.getContext(); ctx.getApplication().put("ap... 阅读全文
posted @ 2013-03-01 20:20 yangkai_keven 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 1.接收请求参数• 采用基本类型接收请求参数(get/post)在Action类中定义与请求参数同名的属性,struts2便能自动接收请求参数并赋予给同名属性。请求路径: http://localhost:8080/test/view.action?id=78public class Product... 阅读全文
posted @ 2013-03-01 12:03 yangkai_keven 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 1.通配符1)Execute方法的弊端假设有这样的需求:A. 有一个action为PersonAction。B. 在PersonAction中要实现增、删、改、查四个方法。C. 但是在action中方法的入口只有一个execute方法D. 所以要想完成这样的功能,有一种方法就是在url链接中加参数。... 阅读全文
posted @ 2013-03-01 12:02 yangkai_keven 阅读(141) 评论(0) 推荐(0) 编辑