`
java_frog
  • 浏览: 243835 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

<global-forwards/>子元素

阅读更多
<global-forwards/>子元素

全局转发可以定义几个<forward/>子元素,Struts首先会在<action-mappings>元素中查找对应的<forward>,若找不到,则到全局转发配置中查找。

语法如下:
<global-forwards>
<forward name="唯一的转发的逻辑名称"
path="要转发到的物理资源路径"/>
</global-forwards>

除了name及path属性之外,还有一个redirect属性,如果为true,则调用HttpServletResponse.sendRedirect()方法进行重定向的操作,否则用RequestDispathcer.forward()方法来转发,默认为false

注意:如果为true,则用HttpServletResponse.sendRedirect()方法,此时存储在原来的HttpSerletRequest中的值会丢失。

实例
<global-forwards>
<forward name="toindex" path="/index.jsp"/>
</global-forwards>
分享到:
评论

相关推荐

    struts配置元素详解

    &lt;global-forwards&gt; &lt;forward / &gt; &lt;/global-forwards&gt; &lt;action-mappings&gt; &lt;action path="" attribute="" type="" name="" scope="" validate="" input="" / &gt; &lt;/action-mappings&gt; &lt;controller / &gt; ...

    struts1 demo

    &lt;global-forwards /&gt; &lt;action-mappings&gt; &lt;action path="/login" name="LoginForm" type="com.yza.struts.action.LoginAction" scope="request" input="/index.jsp"&gt; &lt;forward name="success" path="/...

    struts2的入门开发

    &lt;global-forwards/&gt; − &lt;action-mappings&gt; − &lt;action attribute="loginForm" input="/login.jsp" name="loginForm" path="/login" scope="request" type="test.action.LoginAction"&gt; &lt;forward name="success" path=...

    SSH开发纪要整合解决四大问题(中文、jar包冲突、延时加载、模块化)文档

    &lt;global-forwards /&gt; &lt;action-mappings &gt; &lt;action attribute="addForm" input="/add.jsp" --错误时跳转的页面 name="addForm" --Frombean的名字 path="/add" --路径 scope="request" --作用域...

    Struts-1.2.9 修改版(增加了对没有配置的path的处理)

    &lt;global-forwards&gt; &lt;forward name="REQUEST_NOT_CONFIG" path="/error.jsp" /&gt; &lt;/global-forwards&gt; 如果还是不懂,请查看sample目录的示例. updater: selfimpr. blog: http://blog.csdn.net/lgg201 mail: lgg...

    struts基于mvc的开发代码

    &lt;global-forwards &gt; &lt;forward name="test1" path="/test1.jsp" /&gt; &lt;forward name="test2" path="/test2.jsp" /&gt; &lt;forward name="test3" path="/test3.jsp" /&gt; &lt;forward name="scope" path="/sure.jsp" /&gt; &lt;/...

    Myeclipse开发struts+hibernate+spring新手入门--环境配置---项目开发示例

    12 &lt;global-forwards /&gt; 13 &lt;action-mappings&gt; 14 &lt;action attribute="LoginForm" input="/login.jsp" name="LoginForm" path="LoginAction" scope="request" type=...

    Mpeg2_Decoder

    Availability&lt;br&gt;===============&lt;br&gt;&lt;br&gt;The most recent version of the codec source code is available by anonymous&lt;br&gt;ftp from:&lt;br&gt;&lt;br&gt; ftp://ftp.mpeg.org/pub/mpeg/mssg/&lt;br&gt;&lt;br&gt;The directory contains ...

    逼真的Canvas 3D css3地球旋转动画特效.zip

    代码片段: &lt;a-sphere src="img/earth_atmos_4096.jpg" radius="1.5" segments-height="53"&gt;  &lt;a-animation attribute="rotation" dur="10000" ...repeat="indefinite"&gt;&lt;/a-animation&gt; &lt;/a-sphere&gt;

    index.html

    &lt;title&gt;跳动的小球&lt;/title&gt; &lt;style type="text/css"&gt; *{margin:0;padding:0;font-family:"Microsoft Yahei";} body{ overflow: hidden; } #box{ position: absolute; z-index: 1; top: ...

    SMPP V3.3

    Short Message Peer to Peer (SMPP) Interface Specification Introduction... The SMSC forwards responses &lt;br&gt; and short messages (e.g delivery receipts, pager messages) to the external Short Message Entity.

    NS2中AODV主要函数介绍

    if((ih-&gt;saddr() == index) && (ch-&gt;num_forwards() == 0)) Add the IP Header //收到本节点发送的包,说明有路由环路,丢包 else if(ih-&gt;saddr() == index) drop(p, DROP_RTR_ROUTE_LOOP); //本节点是中间节点 ...

    打字效果动画的4种实现方法(超简单)

    &lt;h1 class=typing&gt;打字动画打字动画打字动画&lt;/h1&gt; css样式: .typing{ font-size: 1rem; padding-top: 6%; margin-bottom: 5%; font-weight: normal; letter-spacing: .3rem; -webkit-animation: type 2s ...

    json源码在工程中的使用

    ③ 在根目录中生成 dist 文件夹包含三个文件 dist/json/json-forwards.h dist/json/json.h dist/json.cpp ④ 在 工程目录下, 生成 json 文件夹, 并拷贝 json 目录下。 ⑤ 在 工程中添加现有文件即可。

    添加H.264代码

    1. struct hdr_cmn { ... int opt_num_forwards_; // optimal #forwards // Monarch extn ends; // tx time for this packet in sec double txtime_; inline double& txtime() { return(txtime_); }

    计算机网络第六版答案

    The corresponding traffic intensity is 500/350 =1.43 &gt; 1. Loss will eventually occur for each experiment; but the time when loss first occurs will be different from one experiment to the next due to ...

    sip协议sip协议分析

    From: "873" &lt;sip:873@192.168.1.151&gt;;tag=399697897 To: "873" &lt;sip:873@192.168.1.151&gt; Call-ID: 855535122@192.168.1.153 CSeq: 3866 REGISTER User-Agent: MG3000-X100 Allow: INVITE, ACK, CANCEL, OPTIONS, ...

    动态规划简单邮票分发

    Compute-opt(r) = 1+{Compute-opt(r-ai)} ( 1=&lt;i&lt;=n, r&gt;ai&gt;0 ) Complexity :O(nr) Memory cost:O(n+r) Compute in a bottom-up style to recursive every desired value and array. store value of Compute...

    esp8266 mesh程序,亲测可用

    and forwards packet to specified protocol parser. 6. Mesh_demo provides current lib of mesh with non-os-sdk. 7. Mesh_demo provides recommendation to setup general protocol parser. (mesh_parser.c) 8. ...

Global site tag (gtag.js) - Google Analytics