struts.xml(三)<result>标签详解,跳转

来源:互联网 发布:手机淘宝卖家中心在哪? 编辑:程序博客网 时间:2024/06/06 15:45
Struts2中web组件的跳转
## Action--->JSP
1.Struts2默认 forward跳转
2.重定向(sendRedirect)
<result name='' type='redirect'>重定向选择的跳转视图JSP</result>
3.请求转发(forward)
<result name='' type='dispatcher'>请求转发的jsp</result>
## Action--->Action
1.请求转发forward'
chain:链
<result name='' type='chain'>目标的action的name,不要加/</result>
①指定type为chain
②result标签体写目标的action名字,不要有/
2.重定向sendRedirect
<result name='' type='redirectAction'>目标action的名字</result>

## Action--->Action跨package跳转(跨namespace)
Action---Action
<result name='aa' type='action跳转action的方式'>
<param name="namespace">目标的action所在包的namespace </param>
<param name="actionName">当前namespace的目标action的名字</param>

</result>


0 0
原创粉丝点击