web.xml error-page 不起作用原因

 

xml.xml error-page配置如下:

<error-page>

    <error-code>404</error-code>

    <location>/error404.jsp</location>

</error-page>

<error-page>

    <exception-type>java.lang.Exception<exception-type>

    <location>/exception.jsp<location>

</error-page>

404页面可以显示而异常页面确未显示。

网上搜寻了下,只找到原因1。

1.在IE工具->Internet选项->高级中将显示友好http错误提示的前面的勾取消

2.在struts.xml 中 <constant name="struts.devMode" value="true" /> 设置为false  

 

你可能感兴趣的:(error-page)