public interface WebContext extends Context
开发人员: renhui
开发时间: 2013-4-28
Modifier and Type | Field and Description |
---|---|
static String |
REQUEST_ATTRIBUTE_FROM_WEBCONTEXT |
Modifier and Type | Method and Description |
---|---|
Object |
getObject(String scope,
String key)
获取指定范围内的对象,相当于调用request、session、servletcontext的getAttribute方法
|
javax.servlet.http.HttpServletRequest |
getRequest()
返回请求上下文关联的http请求对象
|
javax.servlet.http.HttpServletResponse |
getResponse()
返回请求上下文中关联的http响应对象
|
javax.servlet.ServletContext |
getServletContext()
取得servletContext对象
|
WebContext |
getWrappedWebContext()
获取包装过的WebContext
|
void |
init(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext)
初始化web上下文方法
|
boolean |
isRequestFinished()
请求是否已终止,例如请求已被重定向了,该请求将被终止,返回true。还有访问的页面已被缓存,可以直接从缓存中获取页面信息,也将返回true,
默认实现是返回false。
|
void |
setObject(String scope,
String key,
Object value)
把对象设置到scope指定的范围内,相当于调用request、session、servletcontext的setAttribute方法
|
void |
setRequest(javax.servlet.http.HttpServletRequest request)
设置请求上下文中关联的http请求对象
|
void |
setResponse(javax.servlet.http.HttpServletResponse response)
设置请求上下文中关联的http响应对象
|
void |
setServletContext(javax.servlet.ServletContext servletContext)
设置servletContext对象
|
clearSubContext, createSubContext, getInSubContext, getItemMap, getParent, getSubContext, getSubContextMap, getTotalItemMap, put, putSubContext, remove, removeSubContext, setParent
static final String REQUEST_ATTRIBUTE_FROM_WEBCONTEXT
void init(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext)
request
- 请求对象response
- 响应对象servletContext
- servlet上下文javax.servlet.http.HttpServletRequest getRequest()
void setRequest(javax.servlet.http.HttpServletRequest request)
request
- http请求对象javax.servlet.http.HttpServletResponse getResponse()
void setResponse(javax.servlet.http.HttpServletResponse response)
response
- http响应对象WebContext getWrappedWebContext()
javax.servlet.ServletContext getServletContext()
void setServletContext(javax.servlet.ServletContext servletContext)
servletContext
- void setObject(String scope, String key, Object value)
scope
- 代表范围,存在,requestScope、sessionScope、applicationScopekey
- 名称value
- 值Object getObject(String scope, String key)
scope
- 代表范围,存在,requestScope、sessionScope、applicationScopekey
- 名称boolean isRequestFinished()
Copyright © 2006–2018 TinyGroup. All rights reserved.