home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 September / PCWorld_2000-09_cd.bin / Komunik / sambar / _setup.1 / javaeng.jar / javax / servlet / ServletException.java < prev    next >
Text File  |  2000-04-03  |  2KB  |  93 lines

  1. /*
  2.  * ServletException.java -- Thrown to indicate a servlet problem
  3.  *
  4.  * Copyright (c) 1998, 1999 by Free Software Foundation, Inc.
  5.  * Written by Paul Siegmann (pauls@euronet.nl)
  6.  *
  7.  * This program is free software; you can redistribute it and/or modify
  8.  * it under the terms of the GNU Library General Public License as published
  9.  * by the Free Software Foundation, version 2. (see COPYING.LIB)
  10.  *
  11.  * This program is distributed in the hope that it will be useful, but
  12.  * WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program; if not, write to the Free Software Foundation
  18.  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307 USA
  19.  */
  20.  
  21. package javax.servlet;
  22.  
  23. /**
  24.  * This exception is thrown by a servlet when a servlet related problem occurs.
  25.  * 
  26. #ifdef SERVLET_2_0
  27.  * @version Servlet API 2.0 
  28. #endif
  29. #ifdef SERVLET_2_1
  30.  * @version Servlet API 2.1
  31. #endif
  32. #ifdef SERVLET_2_2
  33.  * @version Servlet API 2.2
  34. #endif
  35.  * @since Servlet API 1.0
  36.  * @author Paul Siegmann (pauls@euronet.nl)
  37.  */
  38. public class ServletException
  39.     extends Exception 
  40. {
  41.     private Throwable theCause = null;
  42.  
  43.     /**
  44.      * Creates a new ServletException.
  45.      *
  46.      * @since Servlet API 2.0
  47.      */
  48.     public ServletException() {
  49.         super();
  50.     }
  51.  
  52.  
  53.     /**
  54.      * Creates a new ServletException with a message.
  55.      *
  56.      * @since Servlet API 1.0
  57.      *
  58.      * @param message why this exception occured
  59.      */
  60.     public ServletException(String message) {
  61.         super(message);
  62.     }
  63.  
  64. #ifdef SERVLET_2_0
  65. #else
  66.     /**
  67.      * Creates a new ServletException with a message
  68.      * and what caused the exception.
  69.      *
  70.      * @since Servlet API 2.1
  71.      *
  72.      * @param message why this exception occured
  73.      * @param cause what made this exception occur
  74.      */
  75.     public ServletException(String message, Throwable cause) {
  76.         super(message);
  77.         theCause = cause;
  78.     }
  79.  
  80.  
  81.     /**
  82.      * Gives the Throwable that caused this exception if known, otherwise null.
  83.      *
  84.      * @since Servlet API 2.1
  85.      *
  86.      * @return Throwable that caused this exception
  87.      */
  88.     public Throwable getRootCause() {
  89.         return theCause;
  90.     }
  91. #endif
  92. }
  93.