2.2
Error Handling
There are two logical phases in the lifecycle/processing of a JavaServer Page source file:
Translation (or compilation) from JSP page source into a JSP page implementation class
file.
Per client request processing by an instance of the JSP page implementation class.
Errors may occur at any point during processing of either phase. This section describes how
such errors are treated by a compliant implementation.
2.2.1
Translation Time Processing Errors
The translation of a JSP page source into a corresponding JSP page implementation class
using the Java technology by a JSP container can occur at any time between initial
deployment of the JSP page into the runtime environment of a JSP container, and the receipt
and processing of a client request for the target JSP page. If translation occurs prior to the
JSP container receiving a client request for the target (untranslated) JSP page then error
processing and notification is implementation dependent. Fatal translation failures shall result
in subsequent client requests for the translation target to also be failed with the appropriate
error; for HTTP protocols, error status code 500 (Server Error).
2.2.2
Client Request Time Processing Errors
During the processing of client requests, arbitrary runtime errors can occur in either the body
of the JSP page implementation class or in some other code (Java or other implementation
programming language) called from the body of the JSP page implementation class. Such
errors are realized in the page implementation using the Java programming language
exception mechanism to signal their occurrence to caller(s) of the offending behavior
1
.
These exceptions may be caught and handled (as appropriate) in the body of the JSP page
implementation class.
However, any uncaught exceptions thrown from the body of the JSP page implementation
class result in the forwarding of the client request and uncaught exception to the
errorPage
URL specified by the offending JSP page (or the implementation default
behavior, if none is specified).
1. Note that this is independent of scripting language; this requires that unhandled errors occurring in a scripting language
environment used in a JSP container implementation to be signalled to the JSP page implementation class via the Java
programming language exception mechanism.
37
JavaServer Pages 1.1 Specification
November 30, 1999
JSP Web Hosting JavaServer Pages Specifications JSP Hosting
|
|
|
|
TotalRoute.net Business web hosting division of Vision Web Hosting Inc. All rights reserved. |