View Javadoc

    1   /**
    2    *
    3    * Copyright 2003-2004 The Apache Software Foundation
    4    *
    5    *  Licensed under the Apache License, Version 2.0 (the "License");
    6    *  you may not use this file except in compliance with the License.
    7    *  You may obtain a copy of the License at
    8    *
    9    *     http://www.apache.org/licenses/LICENSE-2.0
    10   *
    11   *  Unless required by applicable law or agreed to in writing, software
    12   *  distributed under the License is distributed on an "AS IS" BASIS,
    13   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14   *  See the License for the specific language governing permissions and
    15   *  limitations under the License.
    16   */
    17
    18  //
    19  // This source code implements specifications defined by the Java
    20  // Community Process. In order to remain compliant with the specification
    21  // DO NOT add / change / or delete method signatures!
    22  //
    23
    24  package javax.servlet.jsp;
    25
    26  /**
    27   * Exception to be used by a Tag EventHandler to indicate some unrecoverable
    28   * error.
    29   * This error is to be caught by the top level of the JSP page and will result
    30   * in an error page.
    31   */
    32
    33  public class JspTagException extends JspException {
    34      /**
    35       * Constructs a new JspTagException with the specified message.
    36       * The message can be written to the server log and/or displayed
    37       * for the user.
    38       *
    39       * @param msg a <code>String</code> specifying the text of
    40       *     the exception message
    41       */
    42      public JspTagException(String msg) {
    43  	super( msg );
    44      }
    45
    46      /**
    47       * Constructs a new JspTagException with no message.
    48       */
    49      public JspTagException() {
    50  	super();
    51      }
    52
    53      /**
    54       * Constructs a new JspTagException when the JSP Tag
    55       * needs to throw an exception and include a message
    56       * about the "root cause" exception that interfered with its
    57       * normal operation, including a description message.
    58       *
    59       *
    60       * @param message 		a <code>String</code> containing
    61       *				the text of the exception message
    62       *
    63       * @param rootCause		the <code>Throwable</code> exception
    64       *				that interfered with the JSP Tag's
    65       *				normal operation, making this JSP Tag
    66       *				exception necessary
    67       *
    68       * @since 2.0
    69       */
    70      public JspTagException(String message, Throwable rootCause) {
    71  	super( message, rootCause );
    72      }
    73
    74
    75      /**
    76       * Constructs a new JSP Tag exception when the JSP Tag
    77       * needs to throw an exception and include a message
    78       * about the "root cause" exception that interfered with its
    79       * normal operation.  The exception's message is based on the localized
    80       * message of the underlying exception.
    81       *
    82       * <p>This method calls the <code>getLocalizedMessage</code> method
    83       * on the <code>Throwable</code> exception to get a localized exception
    84       * message. When subclassing <code>JspTagException</code>,
    85       * this method can be overridden to create an exception message
    86       * designed for a specific locale.
    87       *
    88       * @param rootCause 	the <code>Throwable</code> exception
    89       * 				that interfered with the JSP Tag's
    90       *				normal operation, making the JSP Tag
    91       *                          exception necessary
    92       *
    93       * @since 2.0
    94       */
    95
    96      public JspTagException(Throwable rootCause) {
    97  	super( rootCause );
    98      }
    99
    100 }