Class ServletResponseWrapper

java.lang.Object
jakarta.servlet.ServletResponseWrapper
All Implemented Interfaces:
ServletResponse
Direct Known Subclasses:
HttpServletResponseWrapper

public class ServletResponseWrapper extends Object implements ServletResponse
The ServletResponseWrapper API.
Author:
Manfred Riem ([email protected])
  • Constructor Details

    • ServletResponseWrapper

      public ServletResponseWrapper(ServletResponse wrapped)
      Constructor.
      Parameters:
      wrapped - the wrapped response.
  • Method Details

    • flushBuffer

      public void flushBuffer() throws IOException
      Flush the buffer.
      Specified by:
      flushBuffer in interface ServletResponse
      Throws:
      IOException - when an I/O error occurs.
    • getBufferSize

      public int getBufferSize()
      Returns the buffer size.
      Specified by:
      getBufferSize in interface ServletResponse
      Returns:
      the buffer size
    • getCharacterEncoding

      public String getCharacterEncoding()
      Returns the character encoding.
      Specified by:
      getCharacterEncoding in interface ServletResponse
      Returns:
      the character encoding
    • getContentType

      public String getContentType()
      Returns the content type.
      Specified by:
      getContentType in interface ServletResponse
      Returns:
      the content type
    • getLocale

      public Locale getLocale()
      Returns the locale.
      Specified by:
      getLocale in interface ServletResponse
      Returns:
      the locale
    • getOutputStream

      public ServletOutputStream getOutputStream() throws IOException
      Get the output stream.
      Specified by:
      getOutputStream in interface ServletResponse
      Returns:
      the output stream.
      Throws:
      IOException - when an I/O error occurs.
    • getResponse

      public ServletResponse getResponse()
      Returns the wrapped response.
      Returns:
      the wrapped response
    • getWriter

      public PrintWriter getWriter() throws IOException
      Get the writer.
      Specified by:
      getWriter in interface ServletResponse
      Returns:
      the writer.
      Throws:
      IOException - when an I/O error occurs.
    • isCommitted

      public boolean isCommitted()
      Is committed.
      Specified by:
      isCommitted in interface ServletResponse
      Returns:
      true if it is, false otherwise.
    • isWrapperFor

      public boolean isWrapperFor(ServletResponse wrapped)
      Is wrapper for.
      Parameters:
      wrapped - the wrapped response.
      Returns:
      true if we wrap it, false otherwise.
    • isWrapperFor

      public boolean isWrapperFor(Class<?> wrappedType)
      Is wrapper for.
      Parameters:
      wrappedType - the wrapped type.
      Returns:
      true if we wrap it, false otherwise.
    • reset

      public void reset()
      Reset.
      Specified by:
      reset in interface ServletResponse
    • resetBuffer

      public void resetBuffer()
      Reset the buffer.
      Specified by:
      resetBuffer in interface ServletResponse
    • setBufferSize

      public void setBufferSize(int bufferSize)
      Set the buffer size.
      Specified by:
      setBufferSize in interface ServletResponse
      Parameters:
      bufferSize - the buffer size.
    • setCharacterEncoding

      public void setCharacterEncoding(String characterEncoding)
      Set the character encoding.
      Specified by:
      setCharacterEncoding in interface ServletResponse
      Parameters:
      characterEncoding - the character encoding.
    • setContentLength

      public void setContentLength(int contentLength)
      Set the content length.
      Specified by:
      setContentLength in interface ServletResponse
      Parameters:
      contentLength - the content length.
    • setContentLengthLong

      public void setContentLengthLong(long contentLength)
      Set the content length.
      Specified by:
      setContentLengthLong in interface ServletResponse
      Parameters:
      contentLength - the content length.
    • setContentType

      public void setContentType(String contentType)
      Set the content type.
      Specified by:
      setContentType in interface ServletResponse
      Parameters:
      contentType - the content type.
    • setLocale

      public void setLocale(Locale locale)
      Set the locale.
      Specified by:
      setLocale in interface ServletResponse
      Parameters:
      locale - the locale.
    • setResponse

      public void setResponse(ServletResponse wrapped)
      Set the wrapped response.
      Parameters:
      wrapped - the wrapped response.