Source Code Cross Referenced for ServletException.java in  » 6.0-JDK-Core » Servlet-API-by-tomcat » javax » servlet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » Servlet API by tomcat » javax.servlet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 2004 The Apache Software Foundation
003         *
004         * Licensed under the Apache License, Version 2.0 (the "License");
005         * you may not use this file except in compliance with the License.
006         * You may obtain a copy of the License at
007         *
008         *     http://www.apache.org/licenses/LICENSE-2.0
009         *
010         * Unless required by applicable law or agreed to in writing, software
011         * distributed under the License is distributed on an "AS IS" BASIS,
012         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013         * See the License for the specific language governing permissions and
014         * limitations under the License.
015         */
016        package javax.servlet;
017
018        /**
019         * Defines a general exception a servlet can throw when it
020         * encounters difficulty.
021         *
022         * @author 	Various
023         * @version 	$Version$
024         *
025         */
026
027        public class ServletException extends Exception {
028
029            private Throwable rootCause;
030
031            /**
032             * Constructs a new servlet exception.
033             *
034             */
035
036            public ServletException() {
037                super ();
038            }
039
040            /**
041             * Constructs a new servlet exception with the
042             * specified message. The message can be written 
043             * to the server log and/or displayed for the user. 
044             *
045             * @param message 		a <code>String</code> 
046             *				specifying the text of 
047             *				the exception message
048             *
049             */
050
051            public ServletException(String message) {
052                super (message);
053            }
054
055            /**
056             * Constructs a new servlet exception when the servlet 
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 servlet's
067             *				normal operation, making this servlet
068             *				exception necessary
069             *
070             */
071
072            public ServletException(String message, Throwable rootCause) {
073                super (message);
074                this .rootCause = rootCause;
075            }
076
077            /**
078             * Constructs a new servlet exception when the servlet 
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>ServletException</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 servlet's
092             *				normal operation, making the servlet exception
093             *				necessary
094             *
095             */
096
097            public ServletException(Throwable rootCause) {
098                super (rootCause.getLocalizedMessage());
099                this .rootCause = rootCause;
100            }
101
102            /**
103             * Returns the exception that caused this servlet exception.
104             *
105             *
106             * @return			the <code>Throwable</code> 
107             *				that caused this servlet exception
108             *
109             */
110
111            public Throwable getRootCause() {
112                return rootCause;
113            }
114        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.