Struts2之两个Action传值和不传值的struts.xml文件配置
来源:互联网 发布:mysql事务实现原理 编辑:程序博客网 时间:2024/06/16 03:23
例如 在执行完action1之后要直接跳转到action2,并且action1要传一些参数给action2,在struts.xml文件中的配置如下:
<action name="action1" method="">
<result name="success" type="chain">
<param name="actionName">action2</param>
<param name="param1">${param1}</param>
<param name="param2">${param2}</param>
</result>
</action>
注意:
1. 若param1和param2是两个变量,那么在两个action中都要有他们的getter和setter
2. 若param1是常量,那么在action1中只要有一个param1的getter,在action2中要有param1的getter和setter
如果在两个action之间直接跳转而不用传参数,struts.xml文件可以和上面一样,只是没有param标签,还可以使用如下配置:
<action name="action1" method="">
<result name="success" type="redirectAction">action2.action</result>
</action>
即可
- Struts2之两个Action传值和不传值的struts.xml文件配置
- Struts2之两个Action传值和不传值的struts.xml文件配置
- Struts2之两个Action传值和不传值的struts.xml文件配置
- Struts2之两个Action传值和不传值的struts.xml文件配置
- 3.Struts2 struts.xml配置和Action有关的属性
- Struts2学习笔记之与struts.xml配置和Action有关的属性
- Struts2学习笔记之与struts.xml配置和Action有关的属性
- Struts2的配置 struts.xml Action详解
- [Struts2]配置之Result/include多配置struts.xml文件/Action
- struts2的配置之could not find action or result 问题的解决方法(struts.xml文件路径)
- Struts2 两个Action 动态传参数,在struts.xml中配置
- Struts2 文件下载Action及Struts.xml配置
- Struts2学习笔记之struts.xml配置常量和Action处理流程
- Struts2学习笔记之struts.xml配置常量和Action处理流程
- Struts2中struts.xml的Action配置详解
- Struts2中struts.xml的Action配置详解
- Struts2中struts.xml的Action、namespace配置详解
- [转]Struts2中struts.xml的Action配置详解
- 中有关23个经典设计模式的示例
- gitweb在ubuntu上的配置
- 确保真正的线程安全——微软为什么不提供线程安全库
- robotium无法截取到控件的问题
- 解决CSS中float:left后需要clear:both清空的繁琐步骤
- Struts2之两个Action传值和不传值的struts.xml文件配置
- 用java统计网站在线人数
- 栈的两种C++实现
- 堆的详解和使用
- struts2 类型转换
- 测试工程师具备的基本素质
- 跟我一起写Makefile:概述
- oracle 查询忽略大小写
- 调试通过的android手机调用网上.net web service的例子