Class: javax.servlet.ServletResponseWrapper
- public class ServletResponseWrapper
- 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.
Methods
-
ServletResponseWrappertop
public ServletResponseWrapper(ServletResponse response)Creates a ServletResponse adaptor wrapping the given response object. -
flushBuffertop
public void flushBuffer() throws IOExceptionThe default behavior of this method is to call flushBuffer() on the wrapped response object.- Specified by:
- flushBuffer from ServletResponse
-
getBufferSizetop
public int getBufferSize()The default behavior of this method is to return getBufferSize() on the wrapped response object.- Specified by:
- getBufferSize from ServletResponse
-
getCharacterEncodingtop
public String getCharacterEncoding()The default behavior of this method is to return getCharacterEncoding() on the wrapped response object.- Specified by:
- getCharacterEncoding from ServletResponse
-
getContentTypetop
public String getContentType()The default behavior of this method is to return getContentType() on the wrapped response object.- Specified by:
- getContentType from ServletResponse
-
getLocaletop
public Locale getLocale()The default behavior of this method is to return getLocale() on the wrapped response object.- Specified by:
- getLocale from ServletResponse
-
getOutputStreamtop
public ServletOutputStream getOutputStream() throws IOExceptionThe default behavior of this method is to return getOutputStream() on the wrapped response object.- Specified by:
- getOutputStream from ServletResponse
-
getResponsetop
public ServletResponse getResponse()Return the wrapped ServletResponse object. -
getWritertop
public PrintWriter getWriter() throws IOExceptionThe default behavior of this method is to return getWriter() on the wrapped response object.- Specified by:
- getWriter from ServletResponse
-
isCommittedtop
public boolean isCommitted()The default behavior of this method is to return isCommitted() on the wrapped response object.- Specified by:
- isCommitted from ServletResponse
-
resettop
public void reset()The default behavior of this method is to call reset() on the wrapped response object.- Specified by:
- reset from ServletResponse
-
resetBuffertop
public void resetBuffer()The default behavior of this method is to call resetBuffer() on the wrapped response object.- Specified by:
- resetBuffer from ServletResponse
-
setBufferSizetop
public void setBufferSize(int size)The default behavior of this method is to call setBufferSize(int size) on the wrapped response object.- Specified by:
- setBufferSize from ServletResponse
-
setCharacterEncodingtop
public void setCharacterEncoding(String charset)The default behavior of this method is to call setCharacterEncoding(String charset) on the wrapped response object.- Specified by:
- setCharacterEncoding from ServletResponse
-
setContentLengthtop
public void setContentLength(int len)The default behavior of this method is to call setContentLength(int len) on the wrapped response object.- Specified by:
- setContentLength from ServletResponse
-
setContentTypetop
public void setContentType(String type)The default behavior of this method is to call setContentType(String type) on the wrapped response object.- Specified by:
- setContentType from ServletResponse
-
setLocaletop
public void setLocale(Locale loc)The default behavior of this method is to call setLocale(Locale loc) on the wrapped response object.- Specified by:
- setLocale from ServletResponse
-
setResponsetop
public void setResponse(ServletResponse response)Sets the response being wrapped.
