To specify an error page (or URL to an error page) to be displayed to the end user, use the error-url attribute of the sun-web-app element in the sun-web.xml file. For example:
<sun-web-app error-url="webserver-install-dir/error/error1.html"> ... subelements ... </sun-web-app>
For details, see sun-web-app.
If the error-url attribute is specified, it overrides all other mechanisms configured for error reporting.
This attribute should not point to a URL on the Application Server instance, because the error-url cannot be loaded if the server is down. Instead, specify a URL that points to a location on the web server.
The Application Server provides the following options for specifying the error page.
You can specify the error-url to be an HTTP URL. The Application Server forwards the client request to the specified error URL.
You can specify the error-url to be the name of an HTML page in the standard load balancer plug-in’s error pages directory. Do not specify an absolute path in the local file system. The location must be relative to the webserver-install-dir/plugins/lbplugin/errorpages directory.
If you do not specify the error-url attribute in the sun-web.xml file, a default error page , sun-http-lberror.html, from the standard error pages directory, errorpages, is displayed if present.
As part of the load balancer plug-in installation, a directory called errorpages is created in the web server installation directory.
The error page is displayed according to the following rules:
When an error is encountered for an application, the Application Server first checks if the error-url attribute is defined. If it is defined, the Application Server reads the URL attribute and loads the error page.
If the error-url attribute is missing or invalid, the Application Server displays the default error page, sun-http-lb-error.html, from the errorpages directory of the load balancer plug-in.
If the error-url has been defined but the page is missing, the Application Server loads the default error page, sun-http-lb-error.html.
If the default error page is missing, the error is forwarded to the web server.