public class ContextEmpty extends Context
| 构造器和说明 |
|---|
ContextEmpty() |
| 限定符和类型 | 方法和说明 |
|---|---|
InputStream |
bodyAsStream()
获取body内容为Stream
|
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() |
List<UploadedFile> |
files(String key)
获取上传文件
|
void |
flush() |
void |
headerAdd(String key,
String val)
添加 header
|
NvMap |
headerMap()
获取 headerMap
|
void |
headerSet(String key,
String val)
设置 header
|
String |
ip()
获取远程IP
|
String |
method()
获取请求方法
|
void |
output(byte[] bytes)
输出 字节数组
|
void |
output(InputStream stream)
输出 流对象
|
OutputStream |
outputStream()
获取输出流
|
String |
param(String key)
获取参数
|
String |
param(String key,
String def)
获取参数
|
NvMap |
paramMap()
获取所有参数并转为map
|
Map<String,List<String>> |
paramsMap()
获取所有参数并转为Map
|
String[] |
paramValues(String key)
获取参数数组
|
String |
path()
获取请求的URI路径
|
String |
protocol()
获取请求协议
|
String |
queryString()
获取查询字符串
|
void |
redirect(String url)
跳转地址
|
void |
redirect(String url,
int code) |
Object |
request()
获取请求对象
|
Object |
response()
获取响应对象
|
Map<String,Object> |
sessionMap() |
int |
status()
获取输出状态
|
protected void |
statusDoSet(int status) |
URI |
uri()
获取请求的URI
|
String |
url()
获取请求的URL字符串
|
accept, action, attr, attr, attrClear, attrMap, attrSet, attrSet, autoMultipart, autoMultipart, body, body, bodyAsBytes, bodyNew, bodyNew, charset, close, commit, contentType, contentTypeNew, controller, cookieRemove, cookieSet, cookieSet, cookieSet, current, file, forward, getHandled, getLocale, getRendered, header, header, isMultipart, isMultipartFormData, output, output, outputAsFile, outputAsFile, outputAsHtml, outputAsJson, paramAsBean, paramAsDecimal, paramAsDecimal, paramAsDouble, paramAsDouble, paramAsInt, paramAsInt, paramAsLong, paramAsLong, paramsAdd, paramSet, pathAsUpper, pathMap, pathNew, pathNew, protocolAsUpper, realIp, remoting, remotingSet, render, render, renderAndReturn, session, session, sessionAsDouble, sessionAsDouble, sessionAsInt, sessionAsInt, sessionAsLong, sessionAsLong, sessionClear, sessionId, sessionRemove, sessionSet, sessionState, sessionStateInit, setHandled, setLocale, setRendered, status, statusSet, userAgentpublic static Context create()
public long contentLength()
ContextcontentLength 在类中 Contextpublic String contentType()
ContextcontentType 在类中 Contextpublic String queryString()
ContextqueryString 在类中 Contextpublic InputStream bodyAsStream() throws IOException
ContextbodyAsStream 在类中 ContextIOExceptionpublic String[] paramValues(String key)
ContextparamValues 在类中 Contextpublic List<UploadedFile> files(String key) throws Exception
Contextprotected void contentTypeDoSet(String contentType)
contentTypeDoSet 在类中 Contextpublic void output(InputStream stream)
Contextpublic OutputStream outputStream()
ContextoutputStream 在类中 Contextpublic void cookieSet(String key, String val, String domain, String path, int maxAge)
Contextprotected void statusDoSet(int status)
statusDoSet 在类中 Contextpublic void flush()
throws IOException
flush 在类中 ContextIOExceptionCopyright © 2022. All rights reserved.