public class ContextEmpty extends Context
charset, errors, result, sessionState| 构造器和说明 |
|---|
ContextEmpty() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
asyncComplete()
异步完成
|
void |
asyncStart(long timeout,
ContextAsyncListener listener)
异步开始
|
boolean |
asyncSupported()
是否支持异步
|
InputStream |
bodyAsStream()
获取body内容为Stream
|
void |
close()
关闭响应(一些特殊的boot才有效)
|
String |
contentCharset()
获取获取编码类型
|
long |
contentLength()
获取内容长度
|
String |
contentType()
获取内容类型
|
protected void |
contentTypeDoSet(String contentType) |
String |
cookie(String key)
获取 cookie
|
String |
cookie(String key,
String def)
获取 cookie
|
NvMap |
cookieMap()
获取 cookieMap
|
void |
cookieSet(String key,
String val,
String domain,
String path,
int maxAge)
设置 cookie
|
static Context |
create() |
void |
filesDelete()
删除所有上传文件
|
Map<String,List<UploadedFile>> |
filesMap() |
void |
flush()
冲刷
|
void |
headerAdd(String key,
String val)
添加 header
|
NvMap |
headerMap()
获取 headerMap
|
Collection<String> |
headerNamesOfResponse()
获取响应 headerNames
|
String |
headerOfResponse(String name)
获取响应 header
|
void |
headerSet(String key,
String val)
设置 header
|
Map<String,List<String>> |
headersMap()
获取 headersMap
|
Collection<String> |
headerValuesOfResponse(String name)
获取响应 header
|
boolean |
isSecure()
是否为 ssl 请求
|
String |
method()
获取请求方法
|
void |
output(byte[] bytes)
输出 字节数组
|
void |
output(InputStream stream)
输出 流对象
|
void |
outputAsFile(DownloadedFile file)
输出为文件
|
void |
outputAsFile(File file)
输出为文件
|
OutputStream |
outputStream()
获取输出流
|
GZIPOutputStream |
outputStreamAsGzip()
获取输出流 gzip 模式
|
NvMap |
paramMap()
获取所有参数并转为map
|
Map<String,List<String>> |
paramsMap()
获取所有参数并转为Map
|
String |
path() |
String |
protocol()
获取请求协议
|
String |
queryString()
获取查询字符串
|
void |
redirect(String url,
int code)
跳转地址
|
String |
remoteIp()
获取远程IP
|
int |
remotePort()
获取远程Port
|
Object |
request()
获取请求对象
|
ContextEmpty |
request(Object request) |
Object |
response()
获取响应对象
|
ContextEmpty |
response(Object response) |
<T> T |
session(String name,
Class<T> clz)
获取 session 状态
|
double |
sessionAsDouble(String name)
获取 session 状态,并以 double 型输出
|
double |
sessionAsDouble(String name,
double def)
获取 session 状态,并以 double 型输出
|
int |
sessionAsInt(String name)
获取 session 状态,并以 int 型输出
|
int |
sessionAsInt(String name,
int def)
获取 session 状态,并以 int 型输出
|
long |
sessionAsLong(String name)
获取 session 状态,并以 long 型输出
|
long |
sessionAsLong(String name,
long def)
获取 session 状态,并以 long 型输出
|
void |
sessionClear()
清空 session 状态
|
String |
sessionId()
获取 sessionId
|
<T> T |
sessionOrDefault(String name,
T def)
获取 session 状态(类型转换,存在风险)
|
void |
sessionRemove(String name)
移除 session 状态
|
void |
sessionSet(String name,
Object val)
设置 session 状态
|
int |
status()
获取输出状态
|
protected void |
statusDoSet(int status) |
URI |
uri()
获取请求的URI
|
String |
url()
获取请求的URL字符串
|
accept, accept, acceptNew, action, asyncStart, attr, attr, attrClear, attrMap, attrOrDefault, attrSet, attrSet, autoMultipart, autoMultipart, body, body, bodyAsBytes, bodyNew, bodyNew, charset, contentLength, contentType, contentTypeNew, controller, cookieOrDefault, cookieRemove, cookieSet, cookieSet, cookieSet, current, file, files, forward, getHandled, getLocale, getRendered, header, header, headerOrDefault, headerValues, ip, isFormUrlencoded, isMultipart, isMultipartFormData, mainHandler, output, output, outputAsHtml, outputAsJson, param, param, paramAsBean, paramAsDecimal, paramAsDecimal, paramAsDouble, paramAsDouble, paramAsInt, paramAsInt, paramAsLong, paramAsLong, paramOrDefault, paramsAdd, paramSet, paramValues, pathAsLower, pathAsUpper, pathMap, pathNew, pathNew, protocolAsUpper, pull, realIp, redirect, remoting, remotingSet, render, render, renderAndReturn, session, session, sessionState, setHandled, setLocale, setRendered, status, statusSet, userAgentpublic static Context create()
public ContextEmpty request(Object request)
public int remotePort()
ContextremotePort 在类中 Contextpublic long contentLength()
ContextcontentLength 在类中 Contextpublic String contentType()
ContextcontentType 在类中 Contextpublic String contentCharset()
ContextcontentCharset 在类中 Contextpublic String queryString()
ContextqueryString 在类中 Contextpublic InputStream bodyAsStream() throws IOException
ContextbodyAsStream 在类中 ContextIOExceptionpublic Map<String,List<UploadedFile>> filesMap() throws IOException
filesMap 在类中 ContextIOExceptionpublic void filesDelete()
throws IOException
ContextfilesDelete 在类中 ContextIOExceptionpublic Map<String,List<String>> headersMap()
ContextheadersMap 在类中 Contextpublic <T> T sessionOrDefault(String name, @NonNull T def)
ContextsessionOrDefault 在类中 Contextname - 状态名public int sessionAsInt(String name)
ContextsessionAsInt 在类中 Contextname - 状态名public int sessionAsInt(String name, int def)
ContextsessionAsInt 在类中 Contextname - 状态名public long sessionAsLong(String name)
ContextsessionAsLong 在类中 Contextname - 状态名public long sessionAsLong(String name, long def)
ContextsessionAsLong 在类中 Contextname - 状态名public double sessionAsDouble(String name)
ContextsessionAsDouble 在类中 Contextname - 状态名public double sessionAsDouble(String name, double def)
ContextsessionAsDouble 在类中 Contextname - 状态名public void sessionSet(String name, Object val)
ContextsessionSet 在类中 Contextname - 状态名val - 值public void sessionRemove(String name)
ContextsessionRemove 在类中 Contextname - 状态名public void sessionClear()
ContextsessionClear 在类中 Contextpublic ContextEmpty response(Object response)
protected void contentTypeDoSet(String contentType)
contentTypeDoSet 在类中 Contextpublic void output(InputStream stream)
Contextpublic OutputStream outputStream()
ContextoutputStream 在类中 Contextpublic GZIPOutputStream outputStreamAsGzip() throws IOException
ContextoutputStreamAsGzip 在类中 ContextIOExceptionpublic void outputAsFile(DownloadedFile file) throws IOException
ContextoutputAsFile 在类中 ContextIOExceptionpublic void outputAsFile(File file) throws IOException
ContextoutputAsFile 在类中 ContextIOExceptionpublic String headerOfResponse(String name)
ContextheaderOfResponse 在类中 Contextpublic Collection<String> headerValuesOfResponse(String name)
ContextheaderValuesOfResponse 在类中 Contextpublic Collection<String> headerNamesOfResponse()
ContextheaderNamesOfResponse 在类中 Contextpublic void cookieSet(String key, String val, String domain, String path, int maxAge)
Contextprotected void statusDoSet(int status)
statusDoSet 在类中 Contextpublic void flush()
throws IOException
Contextflush 在类中 ContextIOExceptionpublic void close()
throws IOException
Contextclose 在类中 ContextIOExceptionpublic boolean asyncSupported()
ContextasyncSupported 在类中 Contextpublic void asyncStart(long timeout,
ContextAsyncListener listener)
ContextasyncStart 在类中 Contextpublic void asyncComplete()
ContextasyncComplete 在类中 ContextCopyright © 2024. All rights reserved.