You can customize error and exception reports that are sent to clients by creating error pages. 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:
Repository/WebApplication/web-app/etc/404.html
For information about how to use EAServer Manager to set up an error page for a Web application, see “Error pages”.
To set up server-level error pages, set the value of the com.sybase.jaguar.server.servlet.error-page property on the Advanced tab of the Server Properties dialog box. Use the following syntax to define a comma-delimited list of complex properties. Each property includes a location, and either an error code or an exception field.
(location=/file.jsp,error-code=code), (location=/exception.htm,exception=java.lang.Exception)
Where:
The locations of file.jsp and exception.htm are relative to the HTML document root.
code is the error code that triggers the error page.
java.lang.Exception is the fully-qualified Java class name of the exception that triggers the error page.
Copyright © 2003. Sybase Inc. All rights reserved. |
![]() |