<error-page>
<error-code>403</error-code>
<location>/noPermission.jsp</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/noFound.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/serverError.jsp</location>
</error-page>
<!-- java.lang.Exception异常错误,依据这个标记可定义多个类似错误提示 -->
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/serverError.jsp</location>
</error-page>
<!-- java.lang.NullPointerException异常错误,依据这个标记可定义多个类似错误提示 -->
<error-page>
<exception-type>java.lang.NullPointerException</exception-type>
<location>/serverError.jsp</location>
</error-page>
<error-page>
<exception-type>javax.servlet.ServletException</exception-type>
<location>/serverError.jsp</location>
</error-page>
web.xml定义错误或异常页面的友好界面显示
最新推荐文章于 2023-05-02 18:17:35 发布