struts中的redirect,contextRelative
来源:互联网 发布:淘宝云客服工作平台 编辑:程序博客网 时间:2024/06/16 17:25
1.redirect 设为true时表示执行重定向操作;当为false时,表示执行请求转发操作
注 重定向操作一般用命令:response.sendRedirect();
请求转发操作 RequestDispatcher rpath=request.getRequestDispatcher();
rpath.forward(request,response);
jsp中:<jsp:forward page="">
这两个操作的区别请楼主自己查阅资料或到csdn搜索相关主题
2.contextRelative 设为true时表示当前path属性以/开头时,给出的是相对于当前上下文的url。默认为false
================================================
1,redirect设置响应返回类型,redirect="true":重定向 缺省值为redirect="false":转发
2,如果当前路径为http://localhost/moduleA/
<forward name="..." path="/target.jsp" redirect="true" contextRelative="false"/>
执行以上forward时会转向http://localhost/moduleA/target.jsp
如contextRelative="true"时,会转向http://localhost/target.jsp
注 重定向操作一般用命令:response.sendRedirect();
请求转发操作 RequestDispatcher rpath=request.getRequestDispatcher();
rpath.forward(request,response);
jsp中:<jsp:forward page="">
这两个操作的区别请楼主自己查阅资料或到csdn搜索相关主题
2.contextRelative 设为true时表示当前path属性以/开头时,给出的是相对于当前上下文的url。默认为false
================================================
1,redirect设置响应返回类型,redirect="true":重定向 缺省值为redirect="false":转发
2,如果当前路径为http://localhost/moduleA/
<forward name="..." path="/target.jsp" redirect="true" contextRelative="false"/>
执行以上forward时会转向http://localhost/moduleA/target.jsp
如contextRelative="true"时,会转向http://localhost/target.jsp
在struts1.1以上,通常使用module="/moduleA"代替
原文地址:http://blog.sina.com.cn/s/blog_65dcacbb0100hw9j.html
- struts中的redirect,contextRelative
- struts-config.xml文件中的contextRelative
- struts中的redirect
- struts-configxml中contextRelative=true是什么
- 透析struts中的redirect="true"与redirect="false"
- struts redirect
- struts 中foward中的redirect属性的注意点
- struts-redirect tag
- 12.Struts 2 Redirect Action
- Yii中的redirect跳转
- Yii中的redirect跳转
- Struts2中的redirect、redirectAction
- struts中redirect与dispatch的区别
- forword和redirect使用详解[struts]
- Struts Notes(2)--------Action, redirect, OGNL
- Struts.xml中加不加type="redirect"
- Struts 1 Logic 标签 - Forward And Redirect
- shell中的I/O redirect
- vs2008 上传文件的方法
- putty自动登录ssh的问题
- Windows 下Android开发环境搭建
- heap and stack
- C# ListView控件的Click和SelectedIndexChanged事件
- struts中的redirect,contextRelative
- Ubuntu让Firefox支持Java的配置
- Apple有多大?
- 常用SQL语句
- java:全角字符转半角 (II)
- 英特尔进入移动领域以先进工艺对抗ARM
- 主板前置音频接口
- 超越惠普:联想已成全球最大PC厂商?
- iOS Controller 结构图