1.结果跳转方式
1 <struts> 2 3 <constant name="struts.devMode" value="true"></constant> 4 5 <package name="result" namespace="/" extends="struts-default"> 6 <!-- 转发 --> 7 <action name="Demo1Action" class="cn.rocker.a_result.Demo1Action" method="execute"> 8 <result name="success" type="dispatcher">/hello.jsp</result> 9 </action> 10 11 <!-- 重定向 --> 12 <action name="Demo2Action" class="cn.rocker.a_result.Demo2Action" method="execute"> 13 <result name="success" type="redirect">/hello.jsp</result> 14 </action> 15 16 <!-- 转发到action --> 17 <action name="Demo3Action" class="cn.rocker.a_result.Demo3Action" method="execute"> 18 <!-- Chain to another namespace --> 19 <result name="success" type="chain"> 20 <param name="actionName">Demo1Action</param> 21 <param name="namespace">/</param> 22 </result> 23 </action> 24 25 <!-- 重定向到action --> 26 <action name="Demo4Action" class="cn.rocker.a_result.Demo4Action" method="execute"> 27 <!-- Redirect to another namespace --> 28 <result name="success" type="redirectAction"> 29 <param name="actionName">Demo1Action</param> 30 <param name="namespace">/</param> 31 </result> 32 </action> 33 </package> 34 35 <include file="cn/rocker/b_api/struts.xml"></include> 36 37 </struts>