当前位置: 代码迷 >> Web前端 >> struts2中Action完了跳转时直接调用另一个Action
  详细解决方案

struts2中Action完了跳转时直接调用另一个Action

热度:131   发布时间:2013-07-09 09:50:48.0
struts2中Action结束跳转时直接调用另一个Action

只需要在struts.xml中对应的<result>中设置type="redirectAction">

?

<result name="answerQue" type="redirectAction">Question!answer</result>

?

当某个Action返回字符串为"answerQue"时,直接调用Question的answer方法。

还有其他形式的写法可以参考struts2中关于struts.xml的说明文档

  相关解决方案