添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
单身的斑马  ·  【超详细】springboot + ...·  1 月前    · 
痴情的冲锋衣  ·  c# - simple http ...·  1 年前    · 
爱健身的眼镜  ·  C++ Primer:IO 类 - 知乎·  1 年前    · 
All Implemented Interfaces:
Closeable , Flushable , AutoCloseable , HttpMessage , HttpOutputMessage , ServerHttpResponse
public class ServletServerHttpResponse extends Object implements ServerHttpResponse
ServerHttpResponse implementation that is based on a HttpServletResponse .
Since:
Author:
Arjen Poutsma, Rossen Stoyanchev

ServletServerHttpResponse

public ServletServerHttpResponse ( HttpServletResponse servletResponse)
Construct a new instance of the ServletServerHttpResponse based on the given HttpServletResponse .
Parameters:
servletResponse - the servlet response

setStatusCode

public void setStatusCode ( HttpStatusCode status)
Description copied from interface: ServerHttpResponse
Set the HTTP status code of the response.
Specified by:
setStatusCode in interface ServerHttpResponse
Parameters:
status - the HTTP status as an HttpStatus enum value

getHeaders

public HttpHeaders getHeaders ()
Description copied from interface: HttpMessage
Return the headers of this message.
Specified by:
getHeaders in interface HttpMessage
Returns:
a corresponding HttpHeaders object (never null )
public OutputStream getBody () throws IOException
Description copied from interface: HttpOutputMessage
Return the body of the message as an output stream.
Specified by:
getBody in interface HttpOutputMessage
Returns:
the output stream body (never null )
Throws:
IOException - in case of I/O errors
public void flush () throws IOException
Description copied from interface: ServerHttpResponse
Ensure that the headers and the content of the response are written out.

After the first flush, headers can no longer be changed. Only further content writing and content flushing is possible.

Specified by:
flush in interface Flushable
Specified by:
flush in interface ServerHttpResponse
Throws:
IOException
public void close ()
Description copied from interface: ServerHttpResponse
Close this response, freeing any resources created.
Specified by:
close in interface AutoCloseable
Specified by:
close in interface Closeable
Specified by:
close in interface ServerHttpResponse