<!-- ========= START OF TOP NAVBAR ======= -->
<!-- -->
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
javax.servlet
Class ServletResponseWrapper
java.lang.Object
javax.servlet.ServletResponseWrapper
All Implemented Interfaces:
ServletResponse
Direct Known Subclasses:
HttpServletResponseWrapper
public class ServletResponseWrapper
extends Object
implements ServletResponse
Provides a convenient implementation of the ServletResponse interface that can be subclassed by developers wishing to adapt the response from a Servlet. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped response object. 提供了一种实现ServletResponse接口的便捷方式,开发人员想采用来自Servlet的响应的话, 可以对其子类化。该类实现了包装或装饰模式。方法默认调用经过包装的响应对象。
Since:
v 2.3
Version:
$Version$
Author:
Various
See Also:
ServletResponse
<!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- -->
<!-- ========== METHOD SUMMARY =========== -->
<!-- -->
Method Summary |
void |
flushBuffer() The default behavior of this method is to call flushBuffer() on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的flushBuffer()。
|
int |
getBufferSize() The default behavior of this method is to return getBufferSize() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getBufferSize()。
|
String |
getCharacterEncoding() The default behavior of this method is to return getCharacterEncoding() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getCharacterEncoding()。
|
String |
getContentType() The default behavior of this method is to return getContentType() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getContentType()。
|
Locale |
getLocale() The default behavior of this method is to return getLocale() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getLocale()。
|
ServletOutputStream |
getOutputStream() The default behavior of this method is to return getOutputStream() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getOutputStream()。
|
ServletResponse |
getResponse() Return the wrapped ServletResponse object. 返回经过包装的ServletResponse对象。
|
PrintWriter |
getWriter() The default behavior of this method is to return getWriter() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getWriter()。
|
boolean |
isCommitted() The default behavior of this method is to return isCommitted() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的isCommitted()。
|
void |
reset() The default behavior of this method is to call reset() on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的reset()。
|
void |
resetBuffer() The default behavior of this method is to call resetBuffer() on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的resetBuffer()。
|
void |
setBufferSize(intsize) The default behavior of this method is to call setBufferSize(int size) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setBufferSize(int size)。
|
void |
setCharacterEncoding(Stringcharset) The default behavior of this method is to call setCharacterEncoding(String charset) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setCharacterEncoding(String charset)。
|
void |
setContentLength(intlen) The default behavior of this method is to call setContentLength(int len) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setContentLength(int len)。
|
void |
setContentType(Stringtype) The default behavior of this method is to call setContentType(String type) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setContentType(String type)。
|
void |
setLocale(Localeloc) The default behavior of this method is to call setLocale(Locale loc) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setLocale(Locale loc)。
|
void |
setResponse(ServletResponseresponse) Sets the response being wrapped. 设置要包装的响应。
|
<!-- -->
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
<!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- -->
<!-- -->
ServletResponseWrapper
public ServletResponseWrapper(ServletResponseresponse)
Creates a ServletResponse adaptor wrapping the given response object. 创建一个ServletResponse适配器,包装指定的响应对象。
Throws:
IllegalArgumentException
- if the response is null. 如果响应为null时抛出。
<!-- ============ METHOD DETAIL ========== -->
<!-- -->
<!-- -->
getResponse
public ServletResponse getResponse()
Return the wrapped ServletResponse object. 返回经过包装的ServletResponse对象。
<!-- -->
setResponse
public void setResponse(ServletResponseresponse)
Sets the response being wrapped. 设置要包装的响应。
Throws:
IllegalArgumentException
- if the response is null. 如果响应为null时抛出。
<!-- -->
setCharacterEncoding
public void setCharacterEncoding(Stringcharset)
The default behavior of this method is to call setCharacterEncoding(String charset) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setCharacterEncoding(String charset)。
Specified by:
setCharacterEncoding
in interface ServletResponse
Parameters:
charset
- a String specifying only the character set defined by IANA Character Sets (http://www.iana.org/assignments/character-sets) String,只表示由IANA字符集(http://www.iana.org/assignments/character-sets)定义的字符集
Since:
2.4
See Also:
#setLocale
<!-- -->
getCharacterEncoding
public String getCharacterEncoding()
The default behavior of this method is to return getCharacterEncoding() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getCharacterEncoding()。
Specified by:
getCharacterEncoding
in interface ServletResponse
Returns:
a String
specifying the name of the character encoding, for example, UTF-8
String,表示字符编码名称,比如UTF-8
<!-- -->
getOutputStream
public ServletOutputStream getOutputStream()
throws IOException
The default behavior of this method is to return getOutputStream() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getOutputStream()。
Specified by:
getOutputStream
in interface ServletResponse
Returns:
a ServletOutputStream
for writing binary data 输出二进制数据的ServletOutputStream
Throws:
IOException
- if an input or output exception occurred 如果发生输入输出异常时抛出
See Also:
ServletResponse.getWriter()
<!-- -->
getWriter
public PrintWriter getWriter()
throws IOException
The default behavior of this method is to return getWriter() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getWriter()。
Specified by:
getWriter
in interface ServletResponse
Returns:
a PrintWriter
object that can return character data to the client PrintWriter对象,可以返回客户端的字符数据
Throws:
IOException
- if an input or output exception occurred 如果发生输入输出异常时抛出
See Also:
ServletResponse.getOutputStream()
, ServletResponse.setCharacterEncoding(java.lang.String)
<!-- -->
setContentLength
public void setContentLength(intlen)
The default behavior of this method is to call setContentLength(int len) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setContentLength(int len)。
Specified by:
setContentLength
in interface ServletResponse
Parameters:
len
- an integer specifying the length of the content being returned to the client; sets the Content-Length header 整数,表示返回给客户端的内容长度;设置Content-Length头
<!-- -->
setContentType
public void setContentType(Stringtype)
The default behavior of this method is to call setContentType(String type) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setContentType(String type)。
Specified by:
setContentType
in interface ServletResponse
Parameters:
type
- a String
specifying the MIME type of the content String,表示内容的MIME类型
See Also:
ServletResponse.setLocale(java.util.Locale)
, ServletResponse.setCharacterEncoding(java.lang.String)
, ServletResponse.getOutputStream()
, ServletResponse.getWriter()
<!-- -->
getContentType
public String getContentType()
The default behavior of this method is to return getContentType() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getContentType()。
Specified by:
getContentType
in interface ServletResponse
Returns:
a String
specifying the content type, for example, text/html; charset=UTF-8
, or null String,表示内容类型,比如text/html; charset=UTF-8或者为null
Since:
2.4
<!-- -->
setBufferSize
public void setBufferSize(intsize)
The default behavior of this method is to call setBufferSize(int size) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setBufferSize(int size)。
Specified by:
setBufferSize
in interface ServletResponse
Parameters:
size
- the preferred buffer size 采用的缓存大小
See Also:
ServletResponse.getBufferSize()
, ServletResponse.flushBuffer()
, ServletResponse.isCommitted()
, ServletResponse.reset()
<!-- -->
getBufferSize
public int getBufferSize()
The default behavior of this method is to return getBufferSize() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getBufferSize()。
Specified by:
getBufferSize
in interface ServletResponse
Returns:
the actual buffer size used 实际使用的缓存大小
See Also:
ServletResponse.setBufferSize(int)
, ServletResponse.flushBuffer()
, ServletResponse.isCommitted()
, ServletResponse.reset()
<!-- -->
flushBuffer
public void flushBuffer()
throws IOException
The default behavior of this method is to call flushBuffer() on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的flushBuffer()。
Specified by:
flushBuffer
in interface ServletResponse
Throws:
IOException
See Also:
ServletResponse.setBufferSize(int)
, ServletResponse.getBufferSize()
, ServletResponse.isCommitted()
, ServletResponse.reset()
<!-- -->
isCommitted
public boolean isCommitted()
The default behavior of this method is to return isCommitted() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的isCommitted()。
Specified by:
isCommitted
in interface ServletResponse
Returns:
a boolean indicating if the response has been committed 布尔值,表示响应是否被提交
See Also:
ServletResponse.setBufferSize(int)
, ServletResponse.getBufferSize()
, ServletResponse.flushBuffer()
, ServletResponse.reset()
<!-- -->
reset
public void reset()
The default behavior of this method is to call reset() on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的reset()。
Specified by:
reset
in interface ServletResponse
See Also:
ServletResponse.setBufferSize(int)
, ServletResponse.getBufferSize()
, ServletResponse.flushBuffer()
, ServletResponse.isCommitted()
<!-- -->
resetBuffer
public void resetBuffer()
The default behavior of this method is to call resetBuffer() on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的resetBuffer()。
Specified by:
resetBuffer
in interface ServletResponse
See Also:
ServletResponse.setBufferSize(int)
, ServletResponse.getBufferSize()
, ServletResponse.isCommitted()
, ServletResponse.reset()
<!-- -->
setLocale
public void setLocale(Localeloc)
The default behavior of this method is to call setLocale(Locale loc) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setLocale(Locale loc)。
Specified by:
setLocale
in interface ServletResponse
Parameters:
loc
- the locale of the response 响应的locale
See Also:
ServletResponse.getLocale()
, ServletResponse.setContentType(java.lang.String)
, ServletResponse.setCharacterEncoding(java.lang.String)
<!-- -->
getLocale
public Locale getLocale()
The default behavior of this method is to return getLocale() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getLocale()。
Specified by:
getLocale
in interface ServletResponse
See Also:
ServletResponse.setLocale(java.util.Locale)
<!-- ========= 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.*”这样的错误时,通常是因为你的项目缺少了这个库,所以需要引入`javax.servlet.jar`来解决问题。 1. **Java Servlet简介** Java Servlet是Java平台上的一个标准,用于扩展服务器...
javax.servlet.ServletResponseWrapper.class javax.servlet.ServletRequestListener.class javax.servlet.UnavailableException.class javax.servlet.ServletContextListener.class META-INF/maven/org.mortbay....
javax.servlet-api-***.jar中文文档.zip,java,javax.servlet-api-***.jar,javax.servlet,javax.servlet-api,***,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,javax,servlet,api,中文API文档,手册,开发...
包含翻译后的API文档:javax.servlet-3.0.0.v201112011016-javadoc-API文档-中文(简体)版.zip; Maven坐标:org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016; 标签:eclipse、jetty、orbit、javax、...
javax.servlet-api-***.jar中文文档.zip,java,javax.servlet-api-***.jar,javax.servlet,javax.servlet-api,***,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,javax,servlet,api,中文API文档,手册,开发...
javax.servlet-api-***.jar中文文档.zip,java,javax.servlet-api-***.jar,javax.servlet,javax.servlet-api,***,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,javax,servlet,api,中文API文档,手册,开发...
包含翻译后的API文档:javax.servlet-api-4.0.0-javadoc-API文档-中文(简体)版.zip; Maven坐标:javax.servlet:javax.servlet-api:4.0.0; 标签:javax、servlet、api、中文文档、jar包、java; 使用方法:解压翻译...
包含翻译后的API文档:javax.servlet-api-4.0.1-javadoc-API文档-中文(简体)-英语-对照版.zip; Maven坐标:javax.servlet:javax.servlet-api:4.0.1; 标签:javax、servlet、api、jar包、java、中英对照文档; 使用...
包含翻译后的API文档:javax.servlet-3.0.0.v201112011016-javadoc-API文档-中文(简体)-英语-对照版.zip; Maven坐标:org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016; 标签:eclipse、jetty、orbit、...
在Java Web开发中,`javax.servlet.jar`和`javax.servlet.jsp.jar`是两个非常重要的库文件,它们分别提供了Servlet和JSP(JavaServer Pages)的核心API。这两个库是开发基于Java的Web应用程序不可或缺的部分,特别是...
因此,"javax.servlet.jar"和"javax.servlet.jsp.jar"这两个JAR文件在EJB中是默认不包含的,需要单独引入。这两个库是Java Servlet和JavaServer Pages(JSP)技术的基础,对于构建基于Java的Web应用程序至关重要。 ...
javax.servlet JAR包,解决找不到 import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; jar包问题
在Java编程环境中,`javax.servlet.jar` 是一个非常重要的库,它包含了Servlet和JSP(JavaServer Pages)的核心API,是开发Web应用程序的基础组件。这个包由Java EE(Enterprise Edition)标准提供,允许开发者创建...
在IT行业中,尤其是在Java Web开发领域,`javax.servlet-api`和`javax.el`库是至关重要的组件。这些库主要用于实现Servlet规范和表达式语言(EL)功能,它们为开发人员提供了与服务器交互以及处理HTTP请求的能力。...
包含翻译后的API文档:javax.servlet-api-4.0.0-javadoc-API文档-中文(简体)-英语-对照版.zip; Maven坐标:javax.servlet:javax.servlet-api:4.0.0; 标签:javax、servlet、api、中英对照文档、jar包、java; 使用...
文件中包含javax.servlet-api-3.0.1.jar,javax.servlet-api-3.1.0.jar,javax.servlet-api-4.0.0.jar,用来处理java项目运行中找不到servlet JAR的问题,需要的朋友可以下载
在Java Web开发中,`javax.servlet-api-3.1.0.jar`是一个至关重要的组件,它代表了Servlet API的3.1.0版本,是实现服务器端动态网页处理的核心库。Servlet API是Java EE规范的一部分,由Java Community Process (JCP...
在Java服务器页面(JSP)技术中,`javax.servlet.jsp.tagext`包是核心组件之一,它提供了用于创建自定义标签库(Tag Libraries)的接口和类。自定义标签是JSP的一种强大特性,允许开发者将复杂的逻辑封装到可重用的...
javax.servlet的jar包是Java Web开发中不可或缺的一部分,它提供了Servlet和JSP(JavaServer Pages)的核心API,使得开发者能够创建动态web应用程序。这个jar包是Java Servlet规范的一部分,由Java Community ...
javax.servlet.jsp_2.0.0.v201101211617.jar,javax.,servlet,jsp