Struts2 : action跳转时带参数跳转
在实现action跳转到另一个action时,需要携带参数,可以直接在struts.xml配置文件中对应的跳转action的地方加上,参数的配置,用ognl表达式,可以从session中取值。
如果要传递两个参数,中间用&代替&(xml中&要转义)
Eg:
<action name="check_*" class="aexamCheckAction" method="{1}">
<result name="checkpass" type="redirectAction">check_checkpage.action?eid=${#session.eid}</result>
<result name="submituser" type="redirectAction">groupuser_show.action?WorkGroupId=${#session.WorkGroupId}&ExamId=${#session.ExamId}</result>
<result name="checkback" type="redirectAction">check_checkBackPage.action?successtag=1</result>
<result name="findalluser">/WEB-INF/artexam/printGroupUser.jsp</result>
<result name="findUserInfo">/WEB-INF/artexam/UserInfo.jsp</result>
</action>