struts2 action间跳转传值
(方法一):
我现在需要把一个action(action1)中的变量传递到另外的一个action(action2)中,两个action中都定义了属性
String userId,User
user,并且定义了相应的getter,setter方法,在struts.xml中配置如下:
<action name="action1" class="Action1">
<result name="toLiginIndex" type="redirectAction" >
<param name="actionName">Action2</param>
<param name="namespace">/</param> 同一个namespace时可以不写
<param name="user">${user}</param>
<param name="userId">${userId}</param>
</result>
<result name="notLogIn">/index_notLogin.jsp</result>
</action>
这时跳转成功,但是ognl会抛出异常,因为没有flag的set方法
(方法二)
<result name="toLiginIndex" type="chain">
<param name="actionName">Action2</param>
</result>
这时action1的参数就都传到Action2了,Action2没有要Action1传递的参数的声明也可以在页面中显示出参数的值
(方法三)
<result name="topic"
type="redirect">/topicAction!findTopics.do?topicId=${topicId}</result>
- struts2 action间跳转传值
- struts2 action间跳转传值
- struts2-action间跳转及间传值
- Struts2 action之间传值与跳转
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)_forever
- Struts2中action重定向跳转到jsp参数中带有中文
- struts2 action 之间跳转
- Struts2中action重定向跳转到jsp页面两种配置方式
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- struts2 从一个action 跳转到另一个action的两种方法
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- 在Struts2中,form 表单form与action之间传值
- struts/Servlet,action转到jsp后,CSS失效,路径问题(struts2,jsp路径,action路径,action跳转,相对路径,绝对路径)
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- struts2 action以及页面跳转
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- struts2实现只跳转,不用action类的方法
- struts2中action跳转到另一个action的方法
- Struts2 注解中跳转 action
- struts2首页跳转后执行action