Package 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.
Since:
Servlet 2.3
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a ServletResponse adaptor wrapping the given response object.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    The default behavior of this method is to call flushBuffer() on the wrapped response object.
    int
    The default behavior of this method is to return getBufferSize() on the wrapped response object.
    The default behavior of this method is to return getCharacterEncoding() on the wrapped response object.
    The default behavior of this method is to return getContentType() on the wrapped response object.
    The default behavior of this method is to return getLocale() on the wrapped response object.
    The default behavior of this method is to return getOutputStream() on the wrapped response object.
    Return the wrapped ServletResponse object.
    The default behavior of this method is to return getWriter() on the wrapped response object.
    boolean
    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
    Checks (recursively) if this ServletResponseWrapper wraps the given ServletResponse instance.
    void
    The default behavior of this method is to call reset() on the wrapped response object.
    void
    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
    The default behavior of this method is to call setCharacterEncoding(String charset) on the wrapped response object.
    void
    The default behavior of this method is to call setContentLength(int len) on the wrapped response object.
    void
    The default behavior of this method is to call setContentLengthLong(long len) on the wrapped response object.
    void
    The default behavior of this method is to call setContentType(String type) on the wrapped response object.
    void
    The default behavior of this method is to call setLocale(Locale loc) on the wrapped response object.
    void
    Sets the response being wrapped.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait