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