ServletException

Java Servlet Programming, 2nd Edition > A. Servlet API Quick Reference > ServletException

 
< BACKCONTINUE >
ServletException

Synopsis

Class Name: javax.servlet.ServletException

Superclass: java.lang.Exception

Immediate Subclasses: javax.servlet.UnavailableException

Interfaces Implemented: None

Availability: Servlet API 1.0 and later

Description

A generic exception thrown by servlets encountering difficulties.

Class Summary

public class ServletException extends java.lang.Exception {   // Constructors   public ServletException();                                 // New in 2.0   public ServletException(String msg);   public ServletException(String msg, Throwable rootCause);  // New in 2.1   public ServletException(Throwable rootCause);              // New in 2.1   public Throwable getRootCause();                           // New in 2.1 }

Constructors

public ServletException()

public ServletException() public ServletException(String msg) public ServletException(String msg, Throwable rootCause) public ServletException(Throwable rootCause)
Description

Constructs a new ServletException, with an optional descriptive message and an optional "root cause" for the exception. If a message is specified, it can be retrieved by calling getMessage( ); if a root cause is specified, it can be retrieved by calling getRootCause( ). The messages and root cause are usually included in server logs and user error messages. The constructor versions taking a root cause were introduced in Servlet API 2.1.

Instance Methods

getRootCause()

public Throwable getRootCause()
Description

Returns the Throwable object that caused the servlet exception or null if there was no root cause. This method was introduced in Servlet API 2.1.


Last updated on 3/20/2003
Java Servlet Programming, 2nd Edition, © 2001 O'Reilly

< BACKCONTINUE >


Java servlet programming
Java Servlet Programming (Java Series)
ISBN: 0596000405
EAN: 2147483647
Year: 2000
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net