Error pages

You can create 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 for a Web application, or at the server level.

This example illustrates how to declare an error page for a Web application in the deployment descriptor:

<error-page>
  <error-code>404</error-code>
  <location>/etc/404.html</location>
</error-page>

The location is the path relative to the Web application’s context root. For example, /etc/404.html corresponds to this file in your EAServer installation directory, where web-app is the name of the Web application:

deploy/webapps/web-app/etc/404.html