Exceptions are errors detected within your servlet. Exceptions can occur at run-time, such as when a servlet processes form data, or at compile-time, such as when you pre-compile JSPs. You should catch compile-time exceptions before putting your web application into production. This section describes how to handle run-time exceptions in servlets and JSPs.
In a Java servlet, an exception is represented by an instance of the class javax.servlet.ServletException.
You can define how a web application handles errors using the error-page element in the WEB-INF/web.xml file. You can also define error handling for all web applications on the JRun server by adding error-page elements to the SERVER-INF/default-web.xml file.
The error-page element defines exceptions by exception type or by error code, as the following sections describe. The order of these elements in the web.xml file determines the error handler. JRun redirects the error processing to the location specified by the first error-page element that matches the error-code or exception-type.
��
��
��
��
0 comments :
Post a Comment