JSP和Servlet异常处理转发

<error-page>
<!-- 指明异常类型。 -->
<exception-type>java.lang.ArrayIndexOutOfBoundsException</exception-type>
<!-- 指明错误路径的位置 -->
<location>/error.html</location>
</error-page>

<error-page>
<!-- 指明异常代码(404,500等) -->
<error-code>404</error-code>
<!-- 指明错误路径的位置 -->
<location>/404.html</location>
</error-page>

<error-page>
<error-code>500</error-code>
<location>/500.html</location>
</error-page>

猜你喜欢

转载自www.cnblogs.com/zxx7777777/p/11490834.html