JavaScript is disabled on your browser.
javax.servlet

Class ServletResponseWrapper

  • All Implemented Interfaces:
    ServletResponse
    Direct Known Subclasses:
    HttpServletResponseWrapper


    public class ServletResponseWrapper
    extends java.lang.Object
    implements ServletResponse 
    A convenience class for developers to adapt to a ServletResponse. All methods which are part of the ServletResponse interface fall through to the underlying wrapped object.
    Since:
    2.3
    • Constructor Summary

      Constructors
      Constructor and Description
      ServletResponseWrapper (ServletResponse response)
      Create a new ServletResponseWrapper by wrapping the supplied ServletResponse.
    • Method Summary

      Methods
      Modifier and Type Method and Description
      void flushBuffer ()
      fall through to the underlying object by default.
      int getBufferSize ()
      fall through to the underlying object by default.
      java.lang.String getCharacterEncoding ()
      fall through to the underlying object by default.
      java.lang.String getContentType ()
      get the content type
      java.util.Locale getLocale ()
      fall through to the underlying object by default.
      ServletOutputStream getOutputStream ()
      fall through to the underlying object by default.
      ServletResponse getResponse ()
      get the response from the wrapper.
      java.io.PrintWriter getWriter ()
      fall through to the underlying object by default.
      boolean isCommitted ()
      fall through to the underlying object by default.
      boolean isWrapperFor (java.lang.Class wrappedType)
      Indicates if this wrapper wraps a response of the specified class.
      boolean isWrapperFor (ServletResponse wrapped)
      Indicates if this wrapper wraps the specified response.
      void reset ()
      fall through to the underlying object by default.
      void resetBuffer ()
      fall through to the underlying object by default.
      void setBufferSize (int size)
      fall through to the underlying object by default.
      void setCharacterEncoding (java.lang.String enc)
      set the character encoding.
      void setContentLength (int length)
      fall through to the underlying object by default.
      void setContentType (java.lang.String type)
      fall through to the underlying object by default.
      void setLocale (java.util.Locale locale)
      fall through to the underlying object by default.
      void setResponse (ServletResponse response)
      set a new wrapper
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ServletResponseWrapper

        public ServletResponseWrapper(ServletResponse response)
        Create a new ServletResponseWrapper by wrapping the supplied ServletResponse.
        Parameters:
        response - the object to be wrapped
        Throws:
        java.lang.IllegalArgumentException - if wrappedResponse is null
    • Method Detail

      • getResponse

        public ServletResponse getResponse()
        get the response from the wrapper.
        Returns:
        the servlet response from the wrapper.
      • setResponse

        public void setResponse(ServletResponse response)
        set a new wrapper
        Parameters:
        response - the object to be wrapped
        Throws:
        java.lang.IllegalArgumentException - if wrappedResponse is null
      • setCharacterEncoding

        public void setCharacterEncoding(java.lang.String enc)
        set the character encoding.
        Specified by:
        setCharacterEncoding in interface ServletResponse
        Parameters:
        enc - the character encoding
        Since:
        2.4
      • getCharacterEncoding

        public java.lang.String getCharacterEncoding()
        fall through to the underlying object by default.
        Specified by:
        getCharacterEncoding in interface ServletResponse
        Returns:
        the characterset encoding
      • setContentLength

        public void setContentLength(int length)
        fall through to the underlying object by default.
        Specified by:
        setContentLength in interface ServletResponse
        Parameters:
        length - the number of bytes in the reply
      • setContentType

        public void setContentType(java.lang.String type)
        fall through to the underlying object by default.
        Specified by:
        setContentType in interface ServletResponse
        Parameters:
        type - the mime type of the content
      • getContentType

        public java.lang.String getContentType()
        get the content type
        Specified by:
        getContentType in interface ServletResponse
        Returns:
        the content type
        Since:
        2.4
      • setBufferSize

        public void setBufferSize(int size)
        fall through to the underlying object by default.
        Specified by:
        setBufferSize in interface ServletResponse
        Parameters:
        size - the size in bytes of the buffer
      • getBufferSize

        public int getBufferSize()
        fall through to the underlying object by default.
        Specified by:
        getBufferSize in interface ServletResponse
      • flushBuffer

        public void flushBuffer()
         throws java.io.IOException
        fall through to the underlying object by default.
        Specified by:
        flushBuffer in interface ServletResponse
        Throws:
        java.io.IOException
      • isCommitted

        public boolean isCommitted()
        fall through to the underlying object by default.
        Specified by:
        isCommitted in interface ServletResponse
      • reset

        public void reset()
        fall through to the underlying object by default.
        Specified by:
        reset in interface ServletResponse
        Throws:
        java.lang.IllegalStateException
      • resetBuffer

        public void resetBuffer()
        fall through to the underlying object by default.
        Specified by:
        resetBuffer in interface ServletResponse
      • setLocale

        public void setLocale(java.util.Locale locale)
        fall through to the underlying object by default.
        Specified by:
        setLocale in interface ServletResponse
      • getLocale

        public java.util.Locale getLocale()
        fall through to the underlying object by default.
        Specified by:
        getLocale in interface ServletResponse
      • isWrapperFor

        public boolean isWrapperFor(ServletResponse wrapped)
        Indicates if this wrapper wraps the specified response.
        Since:
        3.0
      • isWrapperFor

        public boolean isWrapperFor(java.lang.Class wrappedType)
        Indicates if this wrapper wraps a response of the specified class.
        Since:
        3.0

AltStyle によって変換されたページ (->オリジナル) /