|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.servlet Class ServletException
java.lang.Object java.lang.Throwable java.lang.Exception javax.servlet.ServletException
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- UnavailableException
public class ServletException
- extends Exception
Extends:
Throwable > Exception
Extended by:
UnavailableException
定义 servlet 遇到困难时可抛出的一般异常。
Defines a general exception a servlet can throw when it encounters difficulty.
- Author:
- Various
- See Also:
- Serialized Form
Constructor Summary | |
---|---|
ServletException()
Constructs a new servlet exception. |
|
ServletException(String message)
Constructs a new servlet exception with the specified message. |
|
ServletException(String message,
Throwable rootCause)
Constructs a new servlet exception when the servlet needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation, including a description message. |
|
ServletException(Throwable rootCause)
Constructs a new servlet exception when the servlet needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation. |
Method Summary | |
---|---|
Throwable |
getRootCause()
Returns the exception that caused this servlet exception. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public
ServletException()
构造新的 servlet 异常。
英文文档:
ServletException
public ServletException()
- Constructs a new servlet exception.
public
ServletException(String message)
构造带指定消息的新 servlet 异常。该消息可以写入到服务器日志和/或向用户显示。
message |
指定异常消息文本的 String |
ServletException
public ServletException(String message)
- Constructs a new servlet exception with the
specified message. The message can be written
to the server log and/or displayed for the user.
- Parameters:
message
- aString
specifying the text of the exception message
public
ServletException(String message, Throwable rootCause)
当 servlet 需要抛出异常并且需要包含有关妨碍 servlet 正常操作的“根本原因”异常的消息时,构造一个新 servlet 异常,该异常包含一条描述消息。
message |
包含异常消息文本的 String |
rootCause |
防碍 servlet 正常操作的 Throwable 异常,使此 servlet 异常成为必需的 |
ServletException
public ServletException(String message, Throwable rootCause)
- Constructs a new servlet exception when the servlet
needs to throw an exception and include a message
about the "root cause" exception that interfered with its
normal operation, including a description message.
- Parameters:
message
- aString
containing the text of the exception messagerootCause
- theThrowable
exception that interfered with the servlet's normal operation, making this servlet exception necessary
public
ServletException(Throwable rootCause)
当 servlet 需要抛出异常并且需要包含有关妨碍 servlet 正常操作的“根本原因”异常的消息时,构造一个新 servlet 异常。该异常消息以底层异常的本地化消息为基础。
此方法调用 Throwable
异常的 getLocalizedMessage
方法获取本地化异常消息。在子类化 ServletException
时,可重写此方法以创建设计用于特定语言环境的异常消息。
rootCause |
防碍 servlet 正常操作的 Throwable 异常,使此 servlet 异常成为必需的 |
ServletException
public ServletException(Throwable rootCause)
- Constructs a new servlet exception when the servlet
needs to throw an exception and include a message
about the "root cause" exception that interfered with its
normal operation. The exception's message is based on the localized
message of the underlying exception.
This method calls the
getLocalizedMessage
method on theThrowable
exception to get a localized exception message. When subclassingServletException
, this method can be overridden to create an exception message designed for a specific locale.- Parameters:
rootCause
- theThrowable
exception that interfered with the servlet's normal operation, making the servlet exception necessary
Method Detail |
---|
public Throwable
getRootCause()
返回导致此 servlet 异常的异常。
return |
导致此 servlet 异常的 Throwable |
getRootCause
public Throwable getRootCause()
- Returns the exception that caused this servlet exception.
- Returns:
- the
Throwable
that caused this servlet exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!