1.實現不管報什麼錯,都將跳轉到一個頁面
方案1、 web.xml裏邊可以配置404頁面和500頁面
<!-- 異常配置 -->
<error-page>
<exception-type>javax.servlet.ServletException</exception-type>
<location>/error.jsp</location>
</error-page>
<!-- 找不到頁面配置 -->
<error-page>
<error-code>404</error-code>
<location>/404.jsp</location>
</error-page>
方案2、過濾器