从action1直接跳转到action2,有两种方法:
- 需要保存前一个action的属性信息时使用:
<result type= "chain ">anotherActionName</result>
2. 不保存前一个action的参数可以用这种方法:
<result type= "redirect-action ">anotherActionName </result>
<struts>
<package name="tutorial" extends = "struts-default">
<action name="Login" class="com.gyj.tutorial.LoginAction">
<result name="success" type="chain">GetBook</result>
<result name="error">/error.jsp</result>
</action>
<action name="GetBook" class = "com.gyj.tutorial.GetBooksAction">
<result name="success">/showBook.jsp</result>
<result name="login">/login.jsp</result>
</action>
</package>
</struts>