错误页面跳转解决办法
在web.xml中配置错误页面跳转如下:
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.html</location>
</error-page>
<!-- 页面不存在时跳转-->
<error-page>
<error-code>500</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/error.html</location>
</error-page>
制造空指针异常,启动tomcat服务器发现并不能跳转到error.jsp,而是跳转到IE的错误提示页面
注意:
1.确保error.jsp的大小>1024字节。
在web.xml中配置错误页面跳转如下:
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.html</location>
</error-page>
<!-- 页面不存在时跳转-->
<error-page>
<error-code>500</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/error.html</location>
</error-page>
制造空指针异常,启动tomcat服务器发现并不能跳转到error.jsp,而是跳转到IE的错误提示页面
注意:
1.确保error.jsp的大小>1024字节。