multiple error-code configuration web.xml

后端 未结 4 829
野趣味
野趣味 2021-01-19 15:05

I\'d like to direct all errors to my Errorsevlet without specifying all the codes explicitly. Is there any way to do like that?


   

        
4条回答
  •  灰色年华
    2021-01-19 15:26

    If you can upgrade, since Servlet 3.0 it's possible to have a generic error page for all errors, even those not caused by an exception (e.g. 404, 401, etc). Just omit the or altogether so that you only have a .

    
       /errorServlet
    
    

    Note that I replaced the URL to avoid the use of Tomcat's builtin and deprecated InvokerServlet.

提交回复
热议问题