web.xml error-page 不起作用解决方案

调试错误跳转页面出现一个问题,即在web.xml中配置的<error-page></error-page>不起作用,在web.xml中配置代码如下:

<!-- <error-page>
      <error-code>500</error-code>
      <location>/500.jsp</location>
</error-page>
-->
<error-page>
      <exception-type>java.lang.Throwable</exception-type>
      <location>/500.jsp</location>
</error-page>

此段代码为页面发生500错误时的跳转规则,解决不能显示的方案如下:

1.在IE【工具】->【Internet选项】->【高级】中勾掉【显示友好http错误提示】
2.确保error.jsp的大小>1024字节
3.确保在500.jsp页面中添加<%@ page isErrorPage="true"%>

你可能感兴趣的:(jsp,Web,xml,IE)