05 dispatcher redirect chain redirectAction的使用
来源:互联网 发布:建筑设计院软件 编辑:程序博客网 时间:2024/04/30 07:38
1. 修改struts.xml
<action name="user_dispatcher">
<result type="dispatcher">/Adminadd_success.jsp</result>
</action>
<action name="user_redirect">
<result type="redirect">/Adminadd_success.jsp</result>
</action>
<action name="user_chain">
<result type="chain">user_redirect</result>
</action>
<action name="user_redirectAction">
<result type="redirectAction">user_dispatcher</result>
</action>
2. 运行
启动tomcat
1) 访问: http://localhost:2000/Gao_struts2/struts/user_dispatcher.action
页面显示:user addsuccess!
页面地址依然是:http://localhost:2000/Gao_struts2/struts/user_dispatcher.action
2) 访问:http://localhost:2000/Gao_struts2/struts/user_redirect.action
页面显示:user add success!
页面地址改为:http://localhost:2000/Gao_struts2/Adminadd_success.jsp
3) 访问:http://localhost:2000/Gao_struts2/struts/user_chain.action
页面显示:user add success!
页面地址改为:http://localhost:2000/Gao_struts2/Adminadd_success.jsp
4) 访问:http://localhost:2000/Gao_struts2/struts/user_redirectAction.action
页面显示:user add success!
页面地址改为:http://localhost:2000/Gao_struts2/struts/user_dispatcher.action
3. 总结
1) dispatcher和redirect用于action跳转到页面。
2) chain和redirectAction用于action跳转到action
3) dispatcher和chain是服务器端跳转,所以他们不会改变客户端浏览器中访问的地址。
4) redirect和redirectAction是客户端跳转,就是说客户端发起action的请求后,服务端会返回action返回的对应的地址给客户 端,客户端会再次发起新的请求给服务器,其中客户端浏览器的地址就是客户端最后访问服务端的地址。
- 05 dispatcher redirect chain redirectAction的使用
- chain redirectAction dispatcher redirect
- Struts2的dispatcher chain redirect和redirectAction的区别
- Struts2的dispatcher,chain,redirect和redirectAction的区别
- Struts2的dispatcher chain redirect和redirectAction的区别
- Struts2的dispatcher chain redirect和redirectAction的区别
- struts2 result type= redirect redirectAction chain dispatcher等类型
- struts2 中chain、redirect、redirectaction的区别
- struts2 中chain、redirect、redirectaction的区别
- struts2 中chain、redirect、redirectaction的区别
- struts2 中chain、redirect、redirectaction的区别 .
- struts2 中chain、redirect、redirectaction的区别
- struts2 中chain、redirect、redirectAction的区别
- struts2 中chain、redirect、redirectaction的区别
- struts2 中chain、redirect、redirectaction的区别
- struts2 中chain、redirect、redirectaction的区别
- struts2 中chain、redirect、redirectaction的区别
- redirect和redirectAction chain的区别
- MFC消息映射机制
- 手贱-写链表玩玩
- oracle 两字段重复
- python中的os.path模块用法(一)
- COM技术初探
- 05 dispatcher redirect chain redirectAction的使用
- 对v$session_longops 的理解
- COM线程模型
- sqlite数据库入门支招--助你少走弯路
- 实验一:双绞线制作
- 开源文化
- 怎么查看自己电脑的激活码 win7
- 将矩阵进行水平镜像和垂直镜像
- MFC 向编辑框中赋值和取值方法