前两种常用,前四种了解,其他不常用(后面会仔细研究,用到再说)
1. dispatcher
(常用,服务器端跳转,浏览器的访问地址对客户透明)
不配的话,默认是dispatcher(用服务器跳转到结果页面jsp,html,freemarker页面,但不能是action)
2. redirect
客户端跳转,跳转到页面
3. chain
用forward的方式,访问action
4. redirectAction
客户端(redirect)跳转到Action
5. freemarker
6. httpheader
发http的头信息过去
7. stream
下载
8. velocity
与freemarker类似,没freemarker好用
9. xslt
xml相关的修饰
10. plaintext
会把页面源码显示出来
11. tiles
把页面分成几块
<package name="resultType" namespace="/r" extends="struts-default" >
<global-allowed-methods>regex:.*</global-allowed-methods>
<!-- 访问http://localhost:8080/hello/r/r1,url显示 http://localhost:8080/hello/r/r1-->
<action name="r1" >
<result type="dispatcher">/resultType/r1.jsp</result>
</action>
<!--访问http://localhost:8080/hello/r/r2,浏览器显示http://localhost:8080/hello/resultType/r2.jsp-->
<action name="r2" >
<result type="redirect">/resultType/r2.jsp</result>
</action>
<!--chain访问同一个包下的action:注意action前面不要加斜杠-->
<!-- 访问http://localhost:8080/hello/r/r3,url显示http://localhost:8080/hello/r/r3,展示r1的jsp-->
<action name="r3" >
<result type="chain">r1</result>
</action>
<!--chain访问不同包下的action:注意action前面不要加斜杠-->
<action name="r5" >
<result type="chain">
<param name="actionName">index</param>
<param name="namespace">/front</param>
</result>
</action>
<!--访问http://localhost:8080/hello/r/r4,url显示http://localhost:8080/hello/resultType/r2.jsp,展示r2的jsp-->
<action name="r4" >
<result type="redirectAction">r2</result>
</action>
</package>