Error pages

Error pages allow you to customize the response that the server sends to Web clients when an error occurs. You can specify HTML files to send in response to HTTP error codes and to Java exceptions thrown in JSPs or servlets. You can also define error pages at the server level. If your Web application does not specify an error page, EAServer invokes the corresponding server-level error page.

When an exception is thrown, the servlet engine will search the error page mappings for the exception and its super classes. For example, assume AException extends BException and BException extends CException and CException extends java.lang.Exception. When AException is thrown, EAServer checks if AException is mapped. If not, EAServer checks if BException is mapped, and so forth.

StepsAdding an error page

  1. Display the File Refs tab in the Web Application Properties dialog box.

  2. Under Error Mapping, click Add. A new row is added to the mapping table with default settings.

  3. Place the cursor in the Error/Exception cell, and type the HTTP error number or Java exception class name.

  4. Place the cursor in the URL cell, and type the path to the file relative to the Web application’s context root. For example, /etc/error404.html.

  5. Verify that the file exists in your EAServer installation directory and can be read by the server process. For example, the path /etc/error404.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/error404.html
    

To set up server-level error pages, see com.sybase.jaguar.server.servlet.error-page on page 553, in the EAServer System Administration Guide.