<!-- ========= START OF TOP NAVBAR ======= -->
<!-- -->
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
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
Defines a general exception a servlet can throw when it encounters difficulty. 定义一个通用异常,servlet遭遇麻烦时抛出。
Version:
$Version$
Author:
Various
See Also:
Serialized Form
<!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- -->
Constructor Summary |
ServletException() Constructs a new servlet exception. 构建一个新的servlet异常。
|
ServletException(Stringmessage) Constructs a new servlet exception with the specified message. 构建一个指定信息的新的servlet异常。
|
ServletException(Stringmessage, ThrowablerootCause) 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. 构建一个新的servlet异常,servlet需要时抛出,包含妨碍正常操作(包括描述信息)的根异常信息。
|
ServletException(ThrowablerootCause) 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. 构建一个新的servlet异常,servlet需要时抛出,包含妨碍正常操作的根异常信息。
|
<!-- ========== METHOD SUMMARY =========== -->
<!-- -->
Method Summary |
Throwable |
getRootCause() Returns the exception that caused this servlet exception. 返回引起servlet异常的异常。
|
<!-- -->
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
<!-- -->
<!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- -->
<!-- -->
ServletException
public ServletException()
Constructs a new servlet exception. 构建一个新的servlet异常。
<!-- -->
ServletException
public ServletException(Stringmessage)
Constructs a new servlet exception with the specified message. The message can be written to the server log and/or displayed for the user. 构建一个指定信息的新的servlet异常。该信息可以输出给 server日志或者显示给用户。
Parameters:
message
- a String
specifying the text of the exception message 指定异常信息文本的String
<!-- -->
ServletException
public ServletException(Stringmessage,
ThrowablerootCause)
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. 构建一个新的servlet异常,servlet需要时抛出,包含妨碍正常操作(包括描述信息)的根异常信息。
Parameters:
message
- a String
containing the text of the exception message 包含异常信息文本的String
rootCause
- the Throwable
exception that interfered with the servlet's normal operation, making this servlet exception necessary 妨碍servlet正常操作的Throwable异常,必要时构建servlet异常
<!-- -->
ServletException
public ServletException(ThrowablerootCause)
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. 构建一个新的servlet异常,servlet需要时抛出,包含妨碍正常操作的根异常信息。该异常信息基于底层异常的本地化信息。
This method calls the getLocalizedMessage
method on the Throwable
exception to get a localized exception message. When subclassing ServletException
, this method can be overridden to create an exception message designed for a specific locale. 该方法调用Throwable异常的getLocalizedMessage方法来获取本地化异常信息。 当子类化ServletException时,可以重写该方法来创建专为本地化设计的异常信息。
Parameters:
rootCause
- the Throwable
exception that interfered with the servlet's normal operation, making the servlet exception necessary 妨碍servlet正常操作的Throwable异常,必要时构建servlet异常
<!-- ============ METHOD DETAIL ========== -->
<!-- -->
<!-- -->
getRootCause
public Throwable getRootCause()
Returns the exception that caused this servlet exception. 返回引起servlet异常的异常。
Returns:
the Throwable
that caused this servlet exception 引起servlet异常的Throwable
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<!-- -->
<!-- ======== END OF BOTTOM NAVBAR ======= -->
Submit a bug or feature
Copyright 2003 Sun Microsystems, Inc. All rights reserved.
分享到:
相关推荐
javax.servlet.ServletException.class javax.servlet.ServletRequest.class javax.servlet.ServletResponse.class javax.servlet.ServletConfig.class javax.servlet.ServletInputStream.class javax.servlet....
在使用servlet.jar和javax.servlet.jar时,开发者需要在Web应用的部署描述符(如web.xml)中声明Servlet实例,指定其类名、URL映射以及可能的初始化参数。例如: ```xml <servlet> <servlet-name>MyServlet</...
启动报错:javax.servlet.ServletException:javax.xml.stream.FactoryConfigurationError: Provider for class javax.xml.stream.XMLInputFactory cannot be created。引入jar包解决问题
### javax.servlet API中文说明知识点详解 #### 一、概述 `javax.servlet` 包是 Java Web 开发的核心组件之一,提供了构建和管理 Servlet 的基础框架。该包定义了一系列的接口和类,使得开发者能够创建可扩展的...
《javax.servlet API参考详解》 在Java Web开发中,`javax.servlet` API是核心部分,它为构建基于HTTP协议的Web应用程序提供了基础框架。本文将深入解析`javax.servlet` API,帮助开发者理解其核心概念、关键接口和...
javax.servlet.ServletException javax.servlet.http.HttpServlet javax.servlet.http.HttpSession javax.servlet.RequestDispatcher javax.servlet.SingleThreadModel javax.servlet.ServletInputStream javax....
### javax.servlet.http 使用详解 #### 一、概述 `javax.servlet.http` 是 Java Servlet 规范中的一个重要包,主要用于处理 HTTP 请求和响应。本篇文档将详细介绍 `javax.servlet.http` 包中的关键接口和类的功能...
doFilter(ServletRequest, ServletResponse, FilterChain) - Method in interface javax.servlet.Filter The doFilter method of the Filter is called by the container each time a request/response pair is ...
包括 javax.servlet.ServletConfig、javax.servlet.FilterConfig(since Servlet 2.3)、javax.servlet.ServletInputStream、javax.servlet.ServletOutputStream、javax.servlet.ServletException 等。 6. Servlet ...
import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import ...
import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; public class Encode implements Filter { public void destroy() { // TODO Auto-...
import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import cn.bean.StudentDetail...
import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import mmb.rec.sys.easyui.EasyuiComBoBoxBean; import mmb.rec.sys....
import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; /** * Servlet Filter implementation...
import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet....
import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; public class Encode implements Filter { public void destroy() {} public void ...
import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet....