顾名思义就是全局的forward了,每个actionmapping都能用的forward在这里定义,比如有异常你要转到一个固定的error页面就不用每个actionmapping都定义一个error forward而在这里定义一个global的error就都可以用了。
解决方案 »
- javax.servlet.ServletException: java.lang.NoSuchMethodError
- 谁有实现在网页上像csdn左边的目录树样式的的代码啊?(十万火急)
- 请教jsp页面的编写方法,如何有效率;如何调试,JB/ECLIPSE
- 建一表格,每行都套一个iframe,它的src指向一报表,显示的时候各报表的距离不一样,怎样解决,在线等待
- jsp册除记录问题!可以册除数据库内的记录,但是有错误提示!
- Resource interpreted as Stylesheet but transferred with MIME type text/html
- 在linux平台用jdbc访问数据库postgres,结果中文字段显示??...
- 各位可否提供几本STRUCTS的书或资料供参考么?
- 如何:jspInit()保存Application级别变量?
- 怎样用tomcat+Appache+jdk配置jsp服务器?很急!!
- 当我点击tomcat\lib\startup.bat为什么闪一下就消失了?
- servlet请进来
如:
<global-forwards>
<forward name="logoff" path="/logoff.do"/>
<forward name="logon" path="/logon.jsp"/>
<forward name="success" path="/mainMenu.jsp"/>
</global-forwards>我不配maping它怎么知道我forwrd某一个,例如转向logon,怎么转?
...
<global-forwards>
<forward name="logoff" path="/logoff.do"/>
<forward name="logon" path="/logon.jsp"/>
<forward name="success" path="/mainMenu.jsp"/>
</global-forwards>
...
<action path="/test/test"
type="test.web.TestAction"
name="testForm"
scope="request"
input="/jsp/test.jsp">
<forward name="success" path="/success.do?actionType=init"/>
</action>
...
在你的TestAction中,如果你用mapping.findForward("success"),就会执行/successs.do,可是如果你用mapping.findForward("logoff");虽然你在action配置中没有定义logoff,可是因为global中有,所以会执行/logoff.do