0
votes

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.

1

1 Answers

0
votes

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>