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>
posted @ 2019-09-09 11:52  什么都不懂的程序猿  阅读(229)  评论(0编辑  收藏  举报