InfoCenter Home > 4.2.1.3.5.2: Example: JSP file for handling application errorsAs illustrated in the following code example, specify "ErrorReport" for the id value. The error page loads an instance of code from the request space named "ErrorReport" to read the properties. If the default scope (scope="page") is used, a new instance of the code is created and the properties are blank. <html> <jsp:useBean id="ErrorReport" class="com.ibm.websphere.servlet.error.ServletErrorReport" scope="request" /> <head> <title> ERROR: <%= ErrorReport.getErrorCode() %> </title> </head> <body> <H1> This error occured while processing the servlet named: <%= ErrorReport.getTargetServletName() %> </H1> <B>My Message: </B><%= ErrorReport.getMessage() %><BR><BR> <B>My StackTrace: </B><%= ErrorReport.getStackTrace() %><BR> </body> </html>
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|