001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one
003     * or more contributor license agreements.  See the NOTICE file
004     * distributed with this work for additional information
005     * regarding copyright ownership.  The ASF licenses this file
006     * to you under the Apache License, Version 2.0 (the
007     * "License"); you may not use this file except in compliance
008     * with the License.  You may obtain a copy of the License at
009     *
010     *  http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing,
013     * software distributed under the License is distributed on an
014     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     * KIND, either express or implied.  See the License for the
016     * specific language governing permissions and limitations
017     * under the License.
018     */
019    
020    //
021    // This source code implements specifications defined by the Java
022    // Community Process. In order to remain compliant with the specification
023    // DO NOT add / change / or delete method signatures!
024    //
025    
026    package javax.servlet.jsp;
027    
028    /**
029     * Exception to be used by a Tag Handler to indicate some unrecoverable
030     * error.
031     * This error is to be caught by the top level of the JSP page and will result
032     * in an error page.
033     */
034    
035    public class JspTagException extends JspException {
036        /**
037         * Constructs a new JspTagException with the specified message.
038         * The message can be written to the server log and/or displayed
039         * for the user.
040         * 
041         * @param msg a <code>String</code> specifying the text of 
042         *     the exception message
043         */
044        public JspTagException(String msg) {
045            super( msg );
046        }
047    
048        /**
049         * Constructs a new JspTagException with no message.
050         */
051        public JspTagException() {
052            super();
053        }
054    
055        /**
056         * Constructs a new JspTagException when the JSP Tag
057         * needs to throw an exception and include a message 
058         * about the "root cause" exception that interfered with its 
059         * normal operation, including a description message.
060         *
061         *
062         * @param message           a <code>String</code> containing 
063         *                          the text of the exception message
064         *
065         * @param rootCause         the <code>Throwable</code> exception 
066         *                          that interfered with the JSP Tag's
067         *                          normal operation, making this JSP Tag
068         *                          exception necessary
069         *
070         * @since 2.0
071         */
072        public JspTagException(String message, Throwable rootCause) {
073            super( message, rootCause );
074        }
075    
076    
077        /**
078         * Constructs a new JSP Tag exception when the JSP Tag
079         * needs to throw an exception and include a message
080         * about the "root cause" exception that interfered with its
081         * normal operation.  The exception's message is based on the localized
082         * message of the underlying exception.
083         *
084         * <p>This method calls the <code>getLocalizedMessage</code> method
085         * on the <code>Throwable</code> exception to get a localized exception
086         * message. When subclassing <code>JspTagException</code>, 
087         * this method can be overridden to create an exception message 
088         * designed for a specific locale.
089         *
090         * @param rootCause         the <code>Throwable</code> exception
091         *                          that interfered with the JSP Tag's
092         *                          normal operation, making the JSP Tag 
093         *                          exception necessary
094         *
095         * @since 2.0
096         */
097    
098        public JspTagException(Throwable rootCause) {
099            super( rootCause );
100        }
101    
102    }