我试图使用Struts2实现以下功能
response.sendRedirect("Pay.jsp?msg=transfer");
Run Code Online (Sandbox Code Playgroud)
这就是我在做的事情:
<action name="AddPayAction" class="controller.AddPayAction">
<param name="paraA"></param>
<param name="paraB"></param>
<param name="msg">SomeMessage</param>
<result name="error">/Error.jsp</result>
<result name="success" type="redirect">/Pay.jsp</result>
</action>
Run Code Online (Sandbox Code Playgroud)
任何建议为什么以上不会被重定向为:
Pay.jsp?msg=SomeMessage
Run Code Online (Sandbox Code Playgroud)
到目前为止,对我有用的解决方案是
<result name="success" type="redirect">
<param name="location">/Pay.jsp?msg=${msg}</param>
</result>
Run Code Online (Sandbox Code Playgroud)
其中msg的setter和getter在action中定义
| 归档时间: |
|
| 查看次数: |
15491 次 |
| 最近记录: |