JavaWeb拦截器

蹲街弑〆低调 提交于 2019-11-27 02:41:49
  <error-page>
        <error-code>400</error-code>
        <location>/error.jsp</location>
    </error-page>
<!-- 404 页面不存在错误 -->
    <error-page>
        <error-code>404</error-code>
        <location>/error.jsp</location>
    </error-page>
   <!-- 500 服务器内部错误 -->
    <error-page>
        <error-code>500</error-code>
        <location>/error.jsp</location>
    </error-page>
    <!-- java.lang.Exception异常错误,依据这个标记可定义多个类似错误提示 -->
    <error-page>
        <exception-type>java.lang.Exception</exception-type>
        <location>/error.jsp</location>
    </error-page>
    <!-- java.lang.NullPointerException异常错误,依据这个标记可定义多个类似错误提示 -->
    <error-page>
        <exception-type>java.lang.NullPointerException</exception-type>
        <location>/error.jsp</location>
    </error-page>
    <error-page>
        <exception-type>javax.servlet.ServletException</exception-type>
        <location>/error.jsp</location>
    </error-page>

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!