public class

ServletServerHttpResponse

extends Object
implements ServerHttpResponse
java.lang.Object
   ↳ org.springframework.http.server.ServletServerHttpResponse

Class Overview

ServerHttpResponse implementation that is based on a HttpServletResponse.

Summary

Public Constructors
ServletServerHttpResponse(HttpServletResponse servletResponse)
Construct a new instance of the ServletServerHttpResponse based on the given HttpServletResponse.
Public Methods
void close()
Close this response, freeing any resources created.
OutputStream getBody()
Return the body of the message as an output stream.
HttpHeaders getHeaders()
Return the headers of this message.
void setStatusCode(HttpStatus status)
Set the HTTP status code of the response.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.http.HttpMessage
From interface org.springframework.http.HttpOutputMessage
From interface org.springframework.http.server.ServerHttpResponse

Public Constructors

public ServletServerHttpResponse (HttpServletResponse servletResponse)

Construct a new instance of the ServletServerHttpResponse based on the given HttpServletResponse.

Parameters
servletResponse the HTTP Servlet response

Public Methods

public void close ()

Close this response, freeing any resources created.

public OutputStream getBody ()

Return the body of the message as an output stream.

Returns
  • the output stream body
Throws
IOException

public HttpHeaders getHeaders ()

Return the headers of this message.

Returns
  • a corresponding HttpHeaders object

public void setStatusCode (HttpStatus status)

Set the HTTP status code of the response.

Parameters
status the HTTP status as an HttpStatus enum value