001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * Portions Copyright Apache Software Foundation.
007: *
008: * The contents of this file are subject to the terms of either the GNU
009: * General Public License Version 2 only ("GPL") or the Common Development
010: * and Distribution License("CDDL") (collectively, the "License"). You
011: * may not use this file except in compliance with the License. You can obtain
012: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
013: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
014: * language governing permissions and limitations under the License.
015: *
016: * When distributing the software, include this License Header Notice in each
017: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
018: * Sun designates this particular file as subject to the "Classpath" exception
019: * as provided by Sun in the GPL Version 2 section of the License file that
020: * accompanied this code. If applicable, add the following below the License
021: * Header, with the fields enclosed by brackets [] replaced by your own
022: * identifying information: "Portions Copyrighted [year]
023: * [name of copyright owner]"
024: *
025: * Contributor(s):
026: *
027: * If you wish your version of this file to be governed by only the CDDL or
028: * only the GPL Version 2, indicate your decision by adding "[Contributor]
029: * elects to include this software in this distribution under the [CDDL or GPL
030: * Version 2] license." If you don't indicate a single choice of license, a
031: * recipient has the option to distribute your version of this file under
032: * either the CDDL, the GPL Version 2 or to extend the choice of license to
033: * its licensees as provided above. However, if you add GPL Version 2 code
034: * and therefore, elected the GPL Version 2 license, then the option applies
035: * only if the new code is made subject to such option by the copyright
036: * holder.
037: */
038: package javax.servlet.jsp;
039:
040: /**
041: * Exception to be used by a Tag Handler to indicate some unrecoverable
042: * error.
043: * This error is to be caught by the top level of the JSP page and will result
044: * in an error page.
045: */
046:
047: public class JspTagException extends JspException {
048: /**
049: * Constructs a new JspTagException with the specified message.
050: * The message can be written to the server log and/or displayed
051: * for the user.
052: *
053: * @param msg a <code>String</code> specifying the text of
054: * the exception message
055: */
056: public JspTagException(String msg) {
057: super (msg);
058: }
059:
060: /**
061: * Constructs a new JspTagException with no message.
062: */
063: public JspTagException() {
064: super ();
065: }
066:
067: /**
068: * Constructs a new JspTagException when the JSP Tag
069: * needs to throw an exception and include a message
070: * about the "root cause" exception that interfered with its
071: * normal operation, including a description message.
072: *
073: *
074: * @param message a <code>String</code> containing
075: * the text of the exception message
076: *
077: * @param rootCause the <code>Throwable</code> exception
078: * that interfered with the JSP Tag's
079: * normal operation, making this JSP Tag
080: * exception necessary
081: *
082: * @since JSP 2.0
083: */
084: public JspTagException(String message, Throwable rootCause) {
085: super (message, rootCause);
086: }
087:
088: /**
089: * Constructs a new JSP Tag exception when the JSP Tag
090: * needs to throw an exception and include a message
091: * about the "root cause" exception that interfered with its
092: * normal operation. The exception's message is based on the localized
093: * message of the underlying exception.
094: *
095: * <p>This method calls the <code>getLocalizedMessage</code> method
096: * on the <code>Throwable</code> exception to get a localized exception
097: * message. When subclassing <code>JspTagException</code>,
098: * this method can be overridden to create an exception message
099: * designed for a specific locale.
100: *
101: * @param rootCause the <code>Throwable</code> exception
102: * that interfered with the JSP Tag's
103: * normal operation, making the JSP Tag
104: * exception necessary
105: *
106: * @since JSP 2.0
107: */
108:
109: public JspTagException(Throwable rootCause) {
110: super(rootCause);
111: }
112:
113: }
|