Interface HttpServerResponse

  • public interface HttpServerResponse
    Server side representation of a HTTP response.
    Darran Lofthouse
    • Method Detail

      • addResponseHeader

        void addResponseHeader​(String headerName,
                               String headerValue)
        Add the specified header and value to the end of the current response headers,
        headerName - the name of the header.
        headerValue - the value of the header.
      • setStatusCode

        void setStatusCode​(int statusCode)
        Set the desired status code for the current request. Note: If multiple mechanisms call this method then a resolution process will begin to decide which one to use.
        statusCode - the response code.
      • setResponseCookie

        void setResponseCookie​(HttpServerCookie cookie)
        Sets a response cookie
        cookie - the cookie
      • getOutputStream

        OutputStream getOutputStream()
        Returns the output stream.
        the output stream or null if not supported.
      • forward

        boolean forward​(String path)
        Forward the current request to a different path.
        true if forwarding was supported and successful, false otherwise.