struts.xml 中配置action返回结果的方式:
一:跳转到页面
如果<result>标签没有指定type的话,默认是<result type="dispatcher">,也就是服务器端页面跳转
<!-- 1:服务器端跳转 -->
<!-- 跳转后URL显示:还是action名(不变) -->
<action name="hello1">
<result type="dispatcher">
/helloStruts2.jsp
</result>
</action>
<!-- 2:客户端跳转 -->
<!-- 跳转后URL显示:下边的jsp名(变为映射的jsp名) -->
<action name="hello2">
<result type="redirect">
/helloStruts2.jsp
</result>
</action>
二:跳转到其他action
<!-- 1:服务器端跳转到目的action -->
<!-- 跳转后URL显示:所请求的action名(不随跳转变) -->
<action name="hello3">
<result type="chain">
hello1
</result>
</action>
<!-- 2:客户端跳转到目的action -->
<!-- 跳转后URL显示:目的action的jsp名(变为映射的jsp名) -->
<action name="hello4">
<result type="redirectAction">
hello1
</result>
</action>
<result type="chain">
<param name="actionName">dashboard</param>
<param name="namespace">/secure</param>
</result>
三:其他方式
还有stream方式(下载时候要配置),FreeMarker等方式,日后用到时候再来补充