6.15.2 Implementation required for customizing the error page
To customize the error page with the in-process HTTP server, use the sendError method of the javax.servlet.http.HttpServletResponse interface, and set the response status code. Note that if you use the setStatus method (such as when the setStatus method is used in JSP), customization might not be executed by the in-process HTTP server. However, even if you use the sendError method, if the Web application fulfills one of the following conditions, the error page is not customized by the in-process HTTP server:
-
If an exception is thrown during the execution of the sendError method
-
When error page customization is specified in the Web application and when an error occurs, the execution of the error page as per the settings terminates normally#
- #
-
Normal termination of error page execution implies the satisfaction of the following conditions:
-
An exception that cannot be caught in the error page does not occur.
-
The status code ends with a value other than 400 to 599.
-