Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress Servlet Development Guide

4.11 Configure Error Pages

An error-page element defines a resource to handle errors of a specific type. Each error-page element contains an error-code element and a location element. The error-code defines the HTTP error code the element handles. The location element defines the path for forwarding the request. Note that the location can be any resource reachable by the servlet container, including a file within the context, another servlet, or even a remote HTTP resource. For example, the web.xml fragment below configures the container to return the contents of the file 404.html when a servlet returns HTTP error code 404.

In a location element, the path to a file is relative to the root directory of the context. In the example above, the file 404.html must be located in the root directory of the context. The directory tree for the example above should look similar to:

As shown above, the 404.html file is in the context root directory, examples, not in the WEB-INF directory.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.