multiple error-code configuration web.xml

后端 未结 4 845
野趣味
野趣味 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:31

    I had same concern and after some research I have found out that unfortunately there is no clear requirement to support default error page in Servlet 3.0 specs.

    It's misleading that "error-code" or "exception-type" are optional tags in XSD so we tend to consider that default error page will be the one without "error-code" and without "exception-type" tag.

    Some application servers (e.g. GlassFish) behave as we wish, take default error page, then following the order of specific error pages they override default error page.

    I also tested this on WebLogic 12c and I couldn't get it working as on GlassFish. Below article gives more clues about Tomcat.

    See: bz.apache.org/bugzilla/show_bug.cgi?id=52135

提交回复
热议问题