Struts2用通配符配多个action方法
来源:互联网 发布:国外深夜节目软件 编辑:程序博客网 时间:2024/04/27 21:59
使用通配符映射(wildcard mappings)方式:
在struts.xml文件中配置<action…>元素时,它的name、class、method属性都可支持通配符,这种通配符的方式是另一种形式的动态方法调用。
当我们使用通配符定义Action的name属性时,相当于用一个元素action定义了多个逻辑Action:
<action name="user_*" class="org.qiujy.web.struts2.action.UserAction" method="{1}"> <result name="success">/success.jsp</result> <result name="error">/error.jsp</result></action>
如上,<action name=”user_*”>定义一系列请求URL是user_*.action模式的逻辑Action。同时method属性值为一个表达式{1},表示它的值是name
属性值中第一个*的值。例如:用户请求URL为user_login.action时,将调用到UserAction类的login方法;用户请求URL为user_regist.action时,
将调用到UserAction类的regist方法。
- Struts2用通配符配多个action方法
- Struts2 Action配置通配符
- struts2 action通配符
- struts2 05 action通配符
- struts2 & action&通配符
- struts2的action方法匹配以及通配符的使用
- struts2中动态方法调用和使用通配符定义Action
- struts2动态方法调用和使用通配符定义action
- struts2:动态方法调用与通配符定义action
- struts2的action方法匹配以及通配符的使用
- Struts2动态方法调用和使用通配符定义action
- Struts2中Action有很多方法 使用通配符
- 简单理解Struts2 action中动态方法及通配符
- struts2的action方法匹配以及通配符的使用
- struts2-创建Action的三种方法,通配符
- struts2-10动态方法调用和使用通配符定义action
- Struts2 使用通配符定义action
- Struts2使用通配符配置action
- Hibernate学习笔记之一
- char、varchar、text和nchar、nvarchar、ntext的区别
- 情商,是时候增强锻炼了
- Ext.data.Store的基本用法
- Open Flow - a CoverFlow API replacement for the iPhone
- Struts2用通配符配多个action方法
- 深入理解Android消息处理系统——Looper、Handler、Thread
- linux shell 小结
- JSP与Servlet的区别
- 未整理
- Javascript中定义类和静态属性
- 企业虚拟化的思辨(一)
- java笔试中常见的一些基础题
- Android学习之Android广播机制