[Top] [Prev] [Next] [Bottom]
How To Add Error Pages
Even though we call them error pages, the specialized JSP pages we describe here actually display information about exceptions. To add error pages that display exception information to a Web application, follow these steps:
- Write your component so that it throws certain exceptions under certain conditions.
- In the JSP file, use a
page directive with errorPage set to the name of a JSP file that will display a message to the user when an exception occurs.
- Write an error page file, using a
page directive with isErrorPage="true". In the error page file, use the exception object to get information about the exception.
- Use a simple tracking mechanism in your component to help you gather information about what your user was doing when the exception was thrown.
- Use messages, either in your error page file or included from other files, to give your user information relevant to what he or she was doing when the exception was thrown.
[Top] [Prev] [Next] [Bottom]
Copyright © 2000, Sun Microsystems, Inc. All rights
reserved.
|
|