|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.servlet.ServletResponseWrapper
public class ServletResponseWrapper
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| 构造方法摘要 | |
|---|---|
ServletResponseWrapper(ServletResponse response)
Creates a ServletResponse adaptor wrapping the given response object. |
|
| 方法摘要 | |
|---|---|
void |
flushBuffer()
The default behavior of this method is to call flushBuffer() on the wrapped response object. |
int |
getBufferSize()
The default behavior of this method is to return getBufferSize() on the wrapped response object. |
String |
getCharacterEncoding()
The default behavior of this method is to return getCharacterEncoding() on the wrapped response object. |
String |
getContentType()
The default behavior of this method is to return getContentType() on the wrapped response object. |
Locale |
getLocale()
The default behavior of this method is to return getLocale() on the wrapped response object. |
ServletOutputStream |
getOutputStream()
The default behavior of this method is to return getOutputStream() on the wrapped response object. |
ServletResponse |
getResponse()
Return the wrapped ServletResponse object. |
PrintWriter |
getWriter()
The default behavior of this method is to return getWriter() on the wrapped response object. |
boolean |
isCommitted()
The default behavior of this method is to return isCommitted() on the wrapped response object. |
boolean |
isWrapperFor(Class wrappedType)
Checks (recursively) if this ServletResponseWrapper wraps a ServletResponse of the given class type. |
boolean |
isWrapperFor(ServletResponse wrapped)
Checks (recursively) if this ServletResponseWrapper wraps the given ServletResponse instance. |
void |
reset()
The default behavior of this method is to call reset() on the wrapped response object. |
void |
resetBuffer()
The default behavior of this method is to call resetBuffer() on the wrapped response object. |
void |
setBufferSize(int size)
The default behavior of this method is to call setBufferSize(int size) on the wrapped response object. |
void |
setCharacterEncoding(String charset)
The default behavior of this method is to call setCharacterEncoding(String charset) on the wrapped response object. |
void |
setContentLength(int len)
The default behavior of this method is to call setContentLength(int len) on the wrapped response object. |
void |
setContentType(String type)
The default behavior of this method is to call setContentType(String type) on the wrapped response object. |
void |
setLocale(Locale loc)
The default behavior of this method is to call setLocale(Locale loc) on the wrapped response object. |
void |
setResponse(ServletResponse response)
Sets the response being wrapped. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public ServletResponseWrapper(ServletResponse response)
IllegalArgumentException - if the response is null.| 方法详细信息 |
|---|
public ServletResponse getResponse()
public void setResponse(ServletResponse response)
IllegalArgumentException - if the response is null.public void setCharacterEncoding(String charset)
ServletResponse 中的 setCharacterEncodingcharset - a String specifying only the character set
defined by IANA Character Sets
(http://www.iana.org/assignments/character-sets)#setLocalepublic String getCharacterEncoding()
ServletResponse 中的 getCharacterEncodingString specifying the
name of the character encoding, for
example, UTF-8
public ServletOutputStream getOutputStream()
throws IOException
ServletResponse 中的 getOutputStreamServletOutputStream for writing binary data
IOException - if an input or output exception occurredServletResponse.getWriter()
public PrintWriter getWriter()
throws IOException
ServletResponse 中的 getWriterPrintWriter object that
can return character data to the client
IOException - if an input or output exception occurredServletResponse.getOutputStream(),
ServletResponse.setCharacterEncoding(java.lang.String)public void setContentLength(int len)
ServletResponse 中的 setContentLengthlen - an integer specifying the length of the
content being returned to the client; sets
the Content-Length headerpublic void setContentType(String type)
ServletResponse 中的 setContentTypetype - a String specifying the MIME
type of the contentServletResponse.setLocale(java.util.Locale),
ServletResponse.setCharacterEncoding(java.lang.String),
ServletResponse.getOutputStream(),
ServletResponse.getWriter()public String getContentType()
ServletResponse 中的 getContentTypeString specifying the
content type, for example,
text/html; charset=UTF-8,
or nullpublic void setBufferSize(int size)
ServletResponse 中的 setBufferSizesize - the preferred buffer sizeServletResponse.getBufferSize(),
ServletResponse.flushBuffer(),
ServletResponse.isCommitted(),
ServletResponse.reset()public int getBufferSize()
ServletResponse 中的 getBufferSizeServletResponse.setBufferSize(int),
ServletResponse.flushBuffer(),
ServletResponse.isCommitted(),
ServletResponse.reset()
public void flushBuffer()
throws IOException
ServletResponse 中的 flushBufferIOExceptionServletResponse.setBufferSize(int),
ServletResponse.getBufferSize(),
ServletResponse.isCommitted(),
ServletResponse.reset()public boolean isCommitted()
ServletResponse 中的 isCommittedServletResponse.setBufferSize(int),
ServletResponse.getBufferSize(),
ServletResponse.flushBuffer(),
ServletResponse.reset()public void reset()
ServletResponse 中的 resetServletResponse.setBufferSize(int),
ServletResponse.getBufferSize(),
ServletResponse.flushBuffer(),
ServletResponse.isCommitted()public void resetBuffer()
ServletResponse 中的 resetBufferServletResponse.setBufferSize(int),
ServletResponse.getBufferSize(),
ServletResponse.isCommitted(),
ServletResponse.reset()public void setLocale(Locale loc)
ServletResponse 中的 setLocaleloc - the locale of the responseServletResponse.getLocale(),
ServletResponse.setContentType(java.lang.String),
ServletResponse.setCharacterEncoding(java.lang.String)public Locale getLocale()
ServletResponse 中的 getLocaleServletResponse.setLocale(java.util.Locale)public boolean isWrapperFor(ServletResponse wrapped)
ServletResponse instance.
wrapped - the ServletResponse instance to search for
public boolean isWrapperFor(Class wrappedType)
ServletResponse of the given class type.
wrappedType - the ServletResponse class type to
search for
IllegalArgumentException - if the given class does not
implement ServletResponse
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||