01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: package javax.servlet.jsp;
18:
19: /**
20: * A generic exception known to the JSP engine; uncaught
21: * JspExceptions will result in an invocation of the errorpage
22: * machinery.
23: */
24:
25: public class JspException extends Exception {
26:
27: /**
28: * Construct a JspException.
29: */
30: public JspException() {
31: }
32:
33: /**
34: * Constructs a new JSP exception with the
35: * specified message. The message can be written
36: * to the server log and/or displayed for the user.
37: *
38: * @param msg a <code>String</code> specifying the text of the exception
39: * message
40: */
41: public JspException(String msg) {
42: super (msg);
43: }
44:
45: /**
46: * Constructs a new <code>JSPException</code> with the specified detail
47: * message and cause. The cause is saved for later retrieval by the
48: * <code>java.lang.Throwable.getCause()</code> and {@link #getRootCause()}
49: * methods.
50: *
51: * @see <code>java.lang.Exception.Exception(String, Throwable)</code>
52: *
53: * @param message a <code>String</code> containing the text of the
54: * exception message
55: *
56: * @param cause the <code>Throwable</code> exception that
57: * interfered with the JSP's normal operation,
58: * making this JSP exception necessary
59: */
60:
61: public JspException(String message, Throwable cause) {
62: super (message, cause);
63: }
64:
65: /**
66: * Constructs a new <code>JSPException</code> with the specified cause.
67: * The cause is saved for later retrieval by the
68: * <code>java.lang.Throwable.getCause()</code> and {@link #getRootCause()}
69: * methods.
70: *
71: * @see <code>java.lang.Exception.Exception(Throwable)</code>
72: *
73: * @param cause the <code>Throwable</code> exception that
74: * interfered with the JSP's normal operation, making
75: * the JSP exception necessary
76: */
77:
78: public JspException(Throwable cause) {
79: super (cause);
80: }
81:
82: /**
83: * @deprecated As of JSP 2.1, replaced by
84: * <code>java.lang.Throwable.getCause()</code>
85: *
86: * Returns the exception that caused this JSP exception.
87: *
88: * @return the <code>Throwable</code> that caused this JSP exception
89: */
90:
91: public Throwable getRootCause() {
92: return getCause();
93: }
94: }
|