第11章 动态方法调用和使用通配符定义action
2012-02-16 04:24
555 查看
<struts> <constant name="struts.enable.DynamicMethodInvocation" value="false"/> <constant name="struts.action.extension" value="do,action"/> <package name="employee" namespace="/control/employee" extends="struts-default"> <action name="list_*" class="cn.itcast.action.HelloWorldAction" method="{1}"> <result name="success">/WEB-INF/page/message.jsp</result> </action> </package> </struts>
浏览器中输入:http://localhost:8080/struts2/control/employee/list_execute.action
http://localhost:8080/struts2/control/employee/list_addUI.action
来调用action文件中的方法
package cn.itcast.action; public class HelloWorldAction { private String msg; public String getMsg() { return msg; } public String addUI(){ msg = "addUI"; return "success"; } public String execute() throws Exception{ msg = "execute"; return "success"; } }
相关文章推荐
- Struts2_动态方法调用和使用通配符定义action
- struts2-10动态方法调用和使用通配符定义action
- action动态方法调用和使用通配符定义action
- 动态方法调用和使用通配符定义action
- struts2学习笔记--------动态方法调用和使用通配符定义action
- struts2教程:10、动态方法调用和使用通配符定义action
- Struts2动态方法调用和使用通配符定义action
- struts2中动态方法调用和使用通配符定义Action
- struct2动态方法调用和使用通配符定义action
- struts2中动态方法调用和使用通配符定义Action
- struts2动态方法调用和使用通配符定义action
- Struts2学习笔记(七):动态方法调用和使用通配符定义action
- struts2动态方法调用和使用通配符定义action
- Struts2 Action中动态方法调用、通配符的使用
- Struts2.5动态方法调用action和使用通配符访问action
- Struts2 Action中动态方法调用、通配符的使用
- struts2:动态方法调用与通配符定义action
- 第三章Struts2 Action中动态方法调用、通配符的使用
- 6、动态方法调用和使用通配符定义
- 每当使用struts2动态方法调用时,总是出现错误:There is no Action mapped for namespace [/user] and action name [user!add]