public abstract class AbstractWebContextWrapper extends ContextImpl implements WebContext
开发人员: renhui
开发时间: 2013-4-28
REQUEST_ATTRIBUTE_FROM_WEBCONTEXT
Constructor and Description |
---|
AbstractWebContextWrapper() |
AbstractWebContextWrapper(WebContext wrappedContext) |
Modifier and Type | Method and Description |
---|---|
boolean |
exist(String name)
检测参数是否存在
|
protected boolean |
existFromWrapperContext(String name,
WebContext webContext) |
<T> T |
get(String name)
改写get方法,使得可以从父环境中查找,同时,也可以从子环境中查找 先找自己,再找子,再找父
|
protected <T> T |
getFromWrapperContext(String name,
WebContext webContext) |
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
|
WebContext |
getWrappedWebContext(String contextName) |
void |
init(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext)
初始化web上下文方法
|
boolean |
isRequestFinished()
请求是否已终止,例如请求已被重定向了,该请求将被终止,返回true。还有访问的页面已被缓存,可以直接从缓存中获取页面信息,也将返回true,
默认实现是返回false。
|
void |
putSubWebContext(String contextName,
WebContext webContext) |
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对象
|
clear, clearSubContext, contain, containNodeMap, createSubContext, existNodeMap, findNodeMap, getInSubContext, getItemMap, getParent, getSubContext, getSubContextMap, getTotalContext, getTotalItemMap, put, putContext, putSubContext, remove, removeSubContext, renameKey, renameKeyNodeMap, setParent
get, put, putAll, remove, setItemMap, size
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearSubContext, createSubContext, getInSubContext, getItemMap, getParent, getSubContext, getSubContextMap, getTotalItemMap, put, putSubContext, remove, removeSubContext, setParent
public AbstractWebContextWrapper()
public AbstractWebContextWrapper(WebContext wrappedContext)
public javax.servlet.http.HttpServletResponse getResponse()
WebContext
getResponse
in interface WebContext
public void setResponse(javax.servlet.http.HttpServletResponse response)
WebContext
setResponse
in interface WebContext
response
- http响应对象public javax.servlet.http.HttpServletRequest getRequest()
WebContext
getRequest
in interface WebContext
public void setRequest(javax.servlet.http.HttpServletRequest request)
WebContext
setRequest
in interface WebContext
request
- http请求对象public <T> T get(String name)
get
in interface BaseContext
get
in class ContextImpl
name
- 参数名称public boolean exist(String name)
BaseContext
exist
in interface BaseContext
exist
in class ContextImpl
name
- 参数名称protected <T> T getFromWrapperContext(String name, WebContext webContext)
protected boolean existFromWrapperContext(String name, WebContext webContext)
public void init(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext)
WebContext
init
in interface WebContext
request
- 请求对象response
- 响应对象servletContext
- servlet上下文public WebContext getWrappedWebContext()
WebContext
getWrappedWebContext
in interface WebContext
public WebContext getWrappedWebContext(String contextName)
public void putSubWebContext(String contextName, WebContext webContext)
public javax.servlet.ServletContext getServletContext()
WebContext
getServletContext
in interface WebContext
public void setServletContext(javax.servlet.ServletContext servletContext)
WebContext
setServletContext
in interface WebContext
public boolean isRequestFinished()
WebContext
isRequestFinished
in interface WebContext
public void setObject(String scope, String key, Object value)
WebContext
setObject
in interface WebContext
scope
- 代表范围,存在,requestScope、sessionScope、applicationScopekey
- 名称value
- 值public Object getObject(String scope, String key)
WebContext
getObject
in interface WebContext
scope
- 代表范围,存在,requestScope、sessionScope、applicationScopekey
- 名称Copyright © 2006–2018 TinyGroup. All rights reserved.