Structs2 action 通配符
来源:互联网 发布:信息过滤软件 编辑:程序博客网 时间:2024/06/05 17:50
使用action通配符是一种比较方便的配置多个相同格式result行为的方式。
有些时候对Action中方法的调用满足一定的规律,例如edit Action对应edit方法,delete Action对应 delete方法,这个时候我们可以使用方法通配符,
例如:
方式一:
<action name="*Crud" class="example.Crud" method="{1}">
这时,editCrud Action的引用将调用edit方法,同理,deleteCrud Action的引用将调用delete 方法。
方式二:
<action name="Crud_*" class="example.Crud" method="{1}">
方式三:
<action name="Student*" class="com.bjsxt.struts2.action.StudentAction" method="{1}"> <result>/Student{1}_success.jsp</result> </action> <action name="*_*" class="com.bjsxt.struts2.action.{1}Action" method="{2}"> <result>/{1}_{2}_success.jsp</result> </action>
通配符可以不止一个!!!
这样当遇到如下调用的时候可以找到对应的方法。
"action=Crud_input" => input方法
"action=Crud_delete" => delete方法
0 0
- Structs2 action 通配符
- structs2通配符映射There is no Action mapped for namespace
- 【web开发学习笔记】Structs2 Action学习笔记(三)action通配符的使用
- structs2-运用Action
- Java Structs2 动态Action
- structs2之Action与ActionContext
- Structs2 HelloWorld-04 Result和通配符
- Structs2:映射通配符、动态方法调用
- 使用通配符定义Action
- action的通配符
- Struts2 Action配置通配符
- 通配符定义action
- struts2 action通配符
- 使用通配符配置 Action
- 使用通配符定义Action
- struts2 05 action通配符
- 使用通配符配置action
- struts2 & action&通配符
- 如何预防“关节炎”
- 【JavaWeb】基础知识总结02 JSP
- 声明外部变量 extern
- OpenGL 练习06 ColorCube
- 今天安家 CSDN 以后希望能常来
- Structs2 action 通配符
- 一起学习CMake – 01
- OpenGL 练习07 变换矩阵
- 类加载器ClassLoader
- TCP/IP之协议关系与结构
- the c programming language
- OpenGL 练习08 Spinning Cube
- OpenGL 练习09 Walking through a scene
- UML几种类图关系的总结