JavaScript is disabled on your browser.
  • Summary:
  • Nested |
  • Field |
  • Constr |
  • Method
  • Detail:
  • Field |
  • Constr |
  • Method
javax.servlet

Interface ServletResponse

    • Method Summary

      Methods
      Modifier and Type Method and Description
      void flushBuffer ()
      flush away any extant response cache.
      int getBufferSize ()
      get the current size of the response cache buffer.
      java.lang.String getCharacterEncoding ()
      Returns the character encoding in use by this Response
      java.lang.String getContentType ()
      get the content type if it has been set.
      java.util.Locale getLocale ()
      get the locale for the response.
      ServletOutputStream getOutputStream ()
      Creates a ServletOutputStream for the servlet to write the data to.
      java.io.PrintWriter getWriter ()
      Creates a PrintWriter for the servlet to print text to.
      boolean isCommitted ()
      has the response cache been written to the client?
      void reset ()
      reset the current response cache buffer.
      void resetBuffer ()
      Resets the underlying response buffer, but does not clear the response code or headers.
      void setBufferSize (int size)
      set the size of the buffer where caching is used.
      void setCharacterEncoding (java.lang.String encoding)
      sets the character encoding.
      void setContentLength (int length)
      Tells the client how many bytes to expect.
      void setContentType (java.lang.String type)
      Tells the client what mime type to expect
      void setLocale (java.util.Locale locale)
      set the locale for the response.
    • Method Detail

      • getCharacterEncoding

        java.lang.String getCharacterEncoding()
        Returns the character encoding in use by this Response
        Returns:
        the characterset encoding
        Since:
        2.0
      • getContentType

        java.lang.String getContentType()
        get the content type if it has been set.
        Returns:
        the content type if set or null if not.
        Since:
        2.4
      • getOutputStream

        ServletOutputStream getOutputStream()
         throws java.io.IOException
        Creates a ServletOutputStream for the servlet to write the data to. The stream might have a buffer attached to it, the size of which the user might be able to alter.

        No encoding of data written to this stream is done by the container.

        It is only possible to call getWriter or getOutputStream on a response, but not both.

        Returns:
        ServletOutputStream to write binary data
        Throws:
        java.io.IOException - if a i/o exception occurs
        java.lang.IllegalStateException - if getWriter was already called on this response
        See Also:
        which the container might use to provide a buffer for this stream.
      • getWriter

        java.io.PrintWriter getWriter()
         throws java.io.IOException
        Creates a PrintWriter for the servlet to print text to. The writer will have the charset associated with any previously specified content type IF the content type has already been set. If the default char set is acceptable them content type need not be set before this method is called.

        It is only possible to call getWriter or getOutputStream on a response, but not both.

        Returns:
        the created PrintWriter
        Throws:
        java.io.IOException - if a i/o exception occurs
        java.lang.IllegalStateException - if getOutputStream was already called on this response
        java.io.UnsupportedEncodingException - if no suitable character encoding can be used
        Since:
        2.0
        See Also:
        which must be called before this if you want to specify a charset to affect this writer.
      • setCharacterEncoding

        void setCharacterEncoding(java.lang.String encoding)
        sets the character encoding.
        Since:
        2.4
      • setContentLength

        void setContentLength(int length)
        Tells the client how many bytes to expect.
        Parameters:
        length - the number of bytes in the reply
      • setContentType

        void setContentType(java.lang.String type)
        Tells the client what mime type to expect
        Parameters:
        type - the mime type of the content
      • setBufferSize

        void setBufferSize(int size)
        set the size of the buffer where caching is used. Caching is sometimes used on responses to ensure that content length can be written properly.
        Parameters:
        size - the size in bytes of the buffer
        Throws:
        java.lang.IllegalStateException - if content has already been sent.
        Since:
        2.2
      • getBufferSize

        int getBufferSize()
        get the current size of the response cache buffer.
        Since:
        2.2
      • flushBuffer

        void flushBuffer()
         throws java.io.IOException
        flush away any extant response cache.
        Throws:
        java.io.IOException
        Since:
        2.2
      • resetBuffer

        void resetBuffer()
        Resets the underlying response buffer, but does not clear the response code or headers.
        Throws:
        java.lang.IllegalStateException - if the response has already been committed
        Since:
        2.3
      • isCommitted

        boolean isCommitted()
        has the response cache been written to the client?
        Since:
        2.2
      • reset

        void reset()
        reset the current response cache buffer.
        Throws:
        java.lang.IllegalStateException - if content has already been sent.
        Since:
        2.2
      • setLocale

        void setLocale(java.util.Locale locale)
        set the locale for the response.
        Since:
        2.2
      • getLocale

        java.util.Locale getLocale()
        get the locale for the response.
        Since:
        2.2
  • Summary:
  • Nested |
  • Field |
  • Constr |
  • Method
  • Detail:
  • Field |
  • Constr |
  • Method

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