首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

struts:关于<global-exceptions>转发有关问题

2011-12-28 
struts:关于global-exceptions转发问题global-exceptionsexceptionkey nullpointer path /error

struts:关于<global-exceptions>转发问题
<global-exceptions>

<exception   key= "nullpointer "   path= "/error.jsp "   scope= "request "   type= "java.lang.NullPointerException "/>

</global-exceptions>

我在struts-config.xml添加了这个全局异常

问题:我在action中throw   java.lang.NullPointerException这个异常的时候,没有跳转到定的页面,最终还是跳转到了action跳转的页面(该action已经执行了异常),请问各位大虾,还需要怎么样,才能正确执行该全局异常

[解决办法]
lz可以把你action的代码贴出来看看!
[解决办法]
public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm, HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) throws Exception{


热点排行