public class JdkHttpContext extends WebContextBase
_fileMap
charset, errors, result, sessionState
构造器和说明 |
---|
JdkHttpContext(com.sun.net.httpserver.HttpExchange exchange) |
限定符和类型 | 方法和说明 |
---|---|
protected void |
asyncAwait() |
void |
asyncComplete()
异步完成
|
void |
asyncListener(ContextAsyncListener listener)
异步监听
|
void |
asyncStart(long timeout,
java.lang.Runnable runnable)
异步开始
|
boolean |
asyncStarted()
异步已开始
|
boolean |
asyncSupported()
是否支持异步
|
java.lang.String |
body(java.lang.String charset)
获取body内容
|
java.io.InputStream |
bodyAsStream()
获取body内容为Stream
|
void |
close()
关闭响应(一些特殊的boot才有效)
|
long |
contentLength()
获取内容长度
|
protected void |
contentTypeDoSet(java.lang.String contentType) |
MultiMap<java.lang.String> |
cookieMap()
获取小饼字典集合
|
void |
cookieSet(Cookie cookie)
设置 cookie
|
MultiMap<UploadedFile> |
fileMap()
获取上传文件字典集合
|
void |
flush()
冲刷
|
void |
headerAdd(java.lang.String key,
java.lang.String val)
添加 header
|
MultiMap<java.lang.String> |
headerMap()
获取头字典集合
|
java.util.Collection<java.lang.String> |
headerNamesOfResponse()
获取响应 headerNames
|
java.lang.String |
headerOfResponse(java.lang.String name)
获取响应 header
|
void |
headerSet(java.lang.String key,
java.lang.String val)
设置 header
|
java.util.Collection<java.lang.String> |
headerValuesOfResponse(java.lang.String name)
获取响应 header
|
protected void |
innerCommit() |
boolean |
isSecure()
是否为 ssl 请求
|
java.lang.String |
method()
获取请求方法
|
void |
output(byte[] bytes)
输出 字节数组
|
void |
output(java.io.InputStream stream)
输出 流对象
|
java.io.OutputStream |
outputStream()
获取输出流
|
MultiMap<java.lang.String> |
paramMap()
获取参数字典集合
|
java.lang.String |
protocol()
获取请求协议
|
java.lang.String |
queryString()
获取查询字符串
|
void |
redirect(java.lang.String url,
int code)
跳转地址
|
java.lang.String |
remoteIp()
获取远程IP
|
int |
remotePort()
获取远程Port
|
java.lang.Object |
request()
获取请求对象
|
java.lang.Object |
response()
获取响应对象
|
int |
status()
获取输出状态
|
protected void |
statusDoSet(int status) |
java.net.URI |
uri()
获取请求的URI
|
java.lang.String |
url()
获取请求的URL字符串
|
contentCharset, contentType, filesDelete, outputAsFile, outputAsFile, outputStreamAsGzip, path, session, sessionAsDouble, sessionAsDouble, sessionAsInt, sessionAsInt, sessionAsLong, sessionAsLong, sessionClear, sessionId, sessionOrDefault, sessionRemove, sessionReset, sessionSet
accept, accept, acceptNew, action, asyncStart, attr, attrMap, attrNames, attrOrDefault, attrsClear, attrSet, attrSet, autoMultipart, autoMultipart, body, bodyAsBytes, bodyNew, bodyNew, charset, contentLength, contentType, contentTypeNew, controller, cookie, cookieNames, cookieOrDefault, cookieRemove, cookieSet, cookieSet, cookieSet, cookieSet, cookieValues, current, file, fileNames, fileValues, forward, getHandled, getLocale, getRendered, header, headerNames, headerOrDefault, headerValues, isFormUrlencoded, isMultipart, isMultipartFormData, mainHandler, output, output, outputAsHtml, outputAsJson, param, paramAsBean, paramAsDecimal, paramAsDecimal, paramAsDouble, paramAsDouble, paramAsInt, paramAsInt, paramAsLong, paramAsLong, paramNames, paramOrDefault, paramValues, pathAsLower, pathAsUpper, pathMap, pathNew, pathNew, protocolAsUpper, pull, realIp, redirect, referer, remoting, remotingSet, render, render, renderAndReturn, session, sessionState, sessionState, setHandled, setLocale, setRendered, status, userAgent
public int remotePort()
Context
remotePort
在类中 Context
public long contentLength()
Context
contentLength
在类中 Context
public java.lang.String queryString()
Context
queryString
在类中 Context
public java.io.InputStream bodyAsStream() throws java.io.IOException
Context
bodyAsStream
在类中 Context
java.io.IOException
public java.lang.String body(java.lang.String charset) throws java.io.IOException
Context
public MultiMap<UploadedFile> fileMap()
Context
protected void contentTypeDoSet(java.lang.String contentType)
contentTypeDoSet
在类中 Context
public java.io.OutputStream outputStream() throws java.io.IOException
Context
outputStream
在类中 Context
java.io.IOException
public void output(java.io.InputStream stream)
Context
public void headerSet(java.lang.String key, java.lang.String val)
Context
public void headerAdd(java.lang.String key, java.lang.String val)
Context
public java.lang.String headerOfResponse(java.lang.String name)
Context
headerOfResponse
在类中 Context
public java.util.Collection<java.lang.String> headerValuesOfResponse(java.lang.String name)
Context
headerValuesOfResponse
在类中 Context
public java.util.Collection<java.lang.String> headerNamesOfResponse()
Context
headerNamesOfResponse
在类中 Context
public void redirect(java.lang.String url, int code)
Context
protected void statusDoSet(int status)
statusDoSet
在类中 Context
public void flush() throws java.io.IOException
Context
public void close() throws java.io.IOException
Context
protected void innerCommit() throws java.io.IOException
innerCommit
在类中 WebContextBase
java.io.IOException
public boolean asyncSupported()
Context
asyncSupported
在类中 Context
public boolean asyncStarted()
Context
asyncStarted
在类中 Context
public void asyncListener(ContextAsyncListener listener)
Context
asyncListener
在类中 Context
public void asyncStart(long timeout, java.lang.Runnable runnable)
Context
asyncStart
在类中 Context
timeout
- 超时runnable
- 运行器public void asyncComplete()
Context
asyncComplete
在类中 Context
protected void asyncAwait() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
java.lang.InterruptedException
java.util.concurrent.ExecutionException