简体   繁体   中英

will <error-page> catch java.lang.throwable exception in servlet 3.0+ app?

I have a web application with servlet 3.0. For default error pages in the application I have done following in web config.

<error-page>
  <location>error.html> </location>
<error-page>

Will this also catch Java.lang.Throwable exception or do I need to define error page for them seperately with ?

Any links to official documentation will be appreciated.

Thanks.

According to tutorialspoint

If you want to have a generic Error Handler for all the exceptions then you should define following error-page instead of defining separate error-page elements for every exception:

<error-page>
   <exception-type>java.lang.Throwable</exception-type >
<location>/ErrorHandler</location>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM