Class Response

    • Method Detail

      • getHttpOutput

        public HttpOutput getHttpOutput()
      • reopen

        public void reopen()
      • errorClose

        public void errorClose()
      • isIncluding

        public boolean isIncluding()
      • include

        public void include()
      • included

        public void included()
      • addCookie

        public void addCookie​(HttpCookie cookie)
      • replaceCookie

        public void replaceCookie​(HttpCookie cookie)
        Replace (or add) a cookie. Using name, path and domain, look for a matching set-cookie header and replace it.
        Parameters:
        cookie - The cookie to add/replace
      • encodeUrl

        @Deprecated
        public java.lang.String encodeUrl​(java.lang.String url)
        Deprecated.
        Specified by:
        encodeUrl in interface HttpServletResponse
      • encodeRedirectUrl

        @Deprecated
        public java.lang.String encodeRedirectUrl​(java.lang.String url)
        Deprecated.
        Specified by:
        encodeRedirectUrl in interface HttpServletResponse
      • sendError

        public void sendError​(int sc)
                       throws java.io.IOException
        Specified by:
        sendError in interface HttpServletResponse
        Throws:
        java.io.IOException
      • sendError

        public void sendError​(int code,
                              java.lang.String message)
                       throws java.io.IOException
        Send an error response.

        In addition to the servlet standard handling, this method supports some additional codes:

        102
        Send a partial PROCESSING response and allow additional responses
        -1
        Abort the HttpChannel and close the connection/stream
        Specified by:
        sendError in interface HttpServletResponse
        Parameters:
        code - The error code
        message - The message
        Throws:
        java.io.IOException - If an IO problem occurred sending the error response.
      • sendProcessing

        public void sendProcessing()
                            throws java.io.IOException
        Sends a 102-Processing response. If the connection is an HTTP connection, the version is 1.1 and the request has a Expect header starting with 102, then a 102 response is sent. This indicates that the request still be processed and real response can still be sent. This method is called by sendError if it is passed 102.
        Throws:
        java.io.IOException - if unable to send the 102 response
        See Also:
        HttpServletResponse.sendError(int)
      • sendRedirect

        public void sendRedirect​(int code,
                                 java.lang.String location)
                          throws java.io.IOException
        Sends a response with one of the 300 series redirection codes.
        Parameters:
        code - the redirect status code
        location - the location to send in Location headers
        Throws:
        java.io.IOException - if unable to send the redirect
      • sendRedirect

        public void sendRedirect​(java.lang.String location)
                          throws java.io.IOException
        Specified by:
        sendRedirect in interface HttpServletResponse
        Throws:
        java.io.IOException
      • setHeader

        public void setHeader​(HttpHeader name,
                              java.lang.String value)
      • setHeader

        public void setHeader​(java.lang.String name,
                              java.lang.String value)
        Specified by:
        setHeader in interface HttpServletResponse
      • getHeaders

        public java.util.Collection<java.lang.String> getHeaders​(java.lang.String name)
        Specified by:
        getHeaders in interface HttpServletResponse
      • addHeader

        public void addHeader​(java.lang.String name,
                              java.lang.String value)
        Specified by:
        addHeader in interface HttpServletResponse
      • setStatus

        @Deprecated
        public void setStatus​(int sc,
                              java.lang.String sm)
        Deprecated.
        Specified by:
        setStatus in interface HttpServletResponse
      • setStatusWithReason

        public void setStatusWithReason​(int sc,
                                        java.lang.String sm)
      • isWriting

        public boolean isWriting()
      • isStreaming

        public boolean isStreaming()
      • isWritingOrStreaming

        public boolean isWritingOrStreaming()
      • getWriter

        public java.io.PrintWriter getWriter()
                                      throws java.io.IOException
        Specified by:
        getWriter in interface ServletResponse
        Throws:
        java.io.IOException
      • getContentLength

        public long getContentLength()
      • isAllContentWritten

        public boolean isAllContentWritten​(long written)
      • isContentComplete

        public boolean isContentComplete​(long written)
      • closeOutput

        public void closeOutput()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • completeOutput

        @Deprecated
        public void completeOutput()
                            throws java.io.IOException
        Deprecated.
        close the output
        Throws:
        java.io.IOException
      • completeOutput

        public void completeOutput​(Callback callback)
      • getLongContentLength

        public long getLongContentLength()
      • setLongContentLength

        public void setLongContentLength​(long len)
      • flushBuffer

        public void flushBuffer()
                         throws java.io.IOException
        Specified by:
        flushBuffer in interface ServletResponse
        Throws:
        java.io.IOException
      • resetContent

        public void resetContent()
      • resetForForward

        public void resetForForward()
      • setTrailers

        public void setTrailers​(java.util.function.Supplier<HttpFields> trailers)
      • getTrailers

        public java.util.function.Supplier<HttpFields> getTrailers()
      • getCommittedMetaData

        public MetaData.Response getCommittedMetaData()
        Get the MetaData.Response committed for this response. This may differ from the meta data in this response for exceptional responses (eg 4xx and 5xx responses generated by the container) and the committedMetaData should be used for logging purposes.
        Returns:
        The committed MetaData or a newResponseMetaData() if not yet committed.
      • getReason

        public java.lang.String getReason()
      • getHttpFields

        public HttpFields getHttpFields()
      • getContentCount

        public long getContentCount()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • putHeaders

        public void putHeaders​(HttpContent content,
                               long contentLength,
                               boolean etag)