Struts2 Action间如何传值
来源:互联网 发布:h5斗牛源码怎么用 编辑:程序博客网 时间:2024/06/07 23:00
方法一:使用result type="redirect"
配置如下所示:
<result type="redirect" >/action2.action?user.id=${user.id}&user.name=${user.name}....</result>
方法二:使用result type="chain"
chain会把前一个Action里的所有属性值带到下一个Action中来。
<result name="success" type="chain">login</result>
login为另外个Action的配置,但要注意的是后一个Action中也要把属性写出来,并且提供getter,setter
多个空间传值示例:
- <package name="public" extends="webwork-default">
- <!-- Chain creatAccount to login, using the default parameter -->
- <action name="createAccount" class="...">
- <result type="chain">login</result>
- </action>
- <action name="login" class="...">
- <!-- Chain to another namespace -->
- <result type="chain">
- <param name="actionName">dashboard</param>
- <param name="namespace">/secure</param>
- </result>
- </action>
- </package>
- <package name="secure" extends="webwork-default" namespace="/secure">
- <action name="dashboard" class="...">
- <result>dashboard.jsp</result>
- </action>
- </package>
- Struts2 Action间如何传值
- Struts2 Action间如何传值
- Struts2 如何实现同一个action不同方法进行传值
- struts2 action间跳转传值
- Struts2 Action间的传值方法
- struts2 action间跳转传值
- struts2 action间值传递
- 如何在struts2配置文件xml的action中传参数
- 如何在struts2配置文件xml的action中传参数
- struts2中action的传值方式
- struts2 Action获取表单传值
- Struts2里面的action传值方式
- struts2中action的传值方式
- Struts2 action之间传值与跳转
- Struts2中Action的传值方式
- struts2 Action与jsp的传值
- struts2 Action间传递
- struts2的action重定向到另外一个action,如何传参数?
- (二) Mysql存储引擎
- HDOJ 1710
- 打球的巅峰体验
- 国家气象局天气预报JSON数据接口详解
- ruby+selenium-webdriver一步一步完成自动化测试----生成测试报告
- Struts2 Action间如何传值
- 毕业半年,我是如何从一名程序员成长为一名‘准’项目经理
- 巴巴运动网(11--15)
- MFC应用程序中添加控制台窗口
- hibernate连接存储过程
- Windows 7之“上帝模式”
- LCD硬件原理
- 重头再来——创建一个最基本的Windows窗口的代码
- 黑马程序员_JAVA学习日志4_this关键字的应用