类 ServletServerHttpResponse
java.lang.Object
cn.taketoday.http.server.ServletServerHttpResponse
- 所有已实现的接口:
HttpMessage,HttpOutputMessage,ServerHttpResponse,Closeable,Flushable,AutoCloseable
ServerHttpResponse implementation that is based on a HttpServletResponse.- 从以下版本开始:
- 3.0
- 作者:
- Arjen Poutsma, Harry Yang, Rossen Stoyanchev
-
嵌套类概要
嵌套类修饰符和类型类说明private classExtends HttpHeaders with the ability to look up headers already present in the underlying HttpServletResponse. -
字段概要
字段修饰符和类型字段说明private booleanprivate final HttpHeadersprivate booleanprivate HttpHeadersprivate final HttpServletResponse -
构造器概要
构造器构造器说明ServletServerHttpResponse(HttpServletResponse servletResponse) Construct a new instance of the ServletServerHttpResponse based on the givenHttpServletResponse. -
方法概要
修饰符和类型方法说明voidclose()Close this response, freeing any resources created.voidflush()Ensure that the headers and the content of the response are written out.getBody()Return the body of the message as an output stream.Return the headers of this message.Return theHttpServletResponsethis object is based on.voidsetStatusCode(HttpStatusCode status) Set the HTTP status code of the response.private void
-
字段详细资料
-
bodyUsed
private boolean bodyUsed -
headersWritten
private boolean headersWritten -
headers
-
servletResponse
-
readOnlyHeaders
-
-
构造器详细资料
-
ServletServerHttpResponse
Construct a new instance of the ServletServerHttpResponse based on the givenHttpServletResponse.- 参数:
servletResponse- the servlet response
-
-
方法详细资料
-
getServletResponse
Return theHttpServletResponsethis object is based on. -
setStatusCode
从接口复制的说明:ServerHttpResponseSet the HTTP status code of the response.- 指定者:
setStatusCode在接口中ServerHttpResponse- 参数:
status- the HTTP status as an HttpStatus enum value
-
getHeaders
从接口复制的说明:HttpMessageReturn the headers of this message.- 指定者:
getHeaders在接口中HttpMessage- 返回:
- a corresponding HttpHeaders object (never
null)
-
getBody
从接口复制的说明:HttpOutputMessageReturn the body of the message as an output stream.- 指定者:
getBody在接口中HttpOutputMessage- 返回:
- the output stream body (never
null) - 抛出:
IOException- in case of I/O errors
-
flush
从接口复制的说明:ServerHttpResponseEnsure 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.
- 指定者:
flush在接口中Flushable- 指定者:
flush在接口中ServerHttpResponse- 抛出:
IOException
-
close
public void close()从接口复制的说明:ServerHttpResponseClose this response, freeing any resources created.- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Closeable- 指定者:
close在接口中ServerHttpResponse
-
writeHeaders
private void writeHeaders()
-