Using error pages

You can create error pages to customize error and exception reports that are sent to clients. When the servlet engine detects an error or catches an exception thrown by a servlet, it searches for a corresponding error page to handle the response. You can declare error pages at the server level and for a Web application or JavaServer Page (JSP).

You can specify HTML and JSP files to send in response to HTTP error codes and to Java exceptions thrown in JSPs or servlets. For information about JSP error pages, see “JSPs as error pages”.