public class WebContextUtil extends Object
WebContext
相关的辅助类。Modifier and Type | Field and Description |
---|---|
static String |
TINY_CONTEXT_PATH |
static String |
TINY_REQUEST_URI |
static String |
TINY_SERVLET_PATH |
Constructor and Description |
---|
WebContextUtil() |
Modifier and Type | Method and Description |
---|---|
static <R extends WebContext> |
findWebContext(javax.servlet.http.HttpServletRequest request,
Class<R> WebContextInterface)
在指定的request context及其级联的request context中找到一个指定类型的request context。
|
static <R extends WebContext> |
findWebContext(WebContext webContext,
Class<R> webContextInterface)
在指定的request context及其级联的request context中找到一个指定类型的request context。
|
static String |
getServletPath(javax.servlet.http.HttpServletRequest request) |
static WebContext |
getWebContext(javax.servlet.http.HttpServletRequest request)
取得和当前request相关联的
WebContext 对象。 |
static void |
registerRequestDestructionCallback(String name,
Runnable callback)
注册spring
ServletRequestAttributes 中的析构回调方法,这些方法将在request
context被提交之后依次调用。 |
static void |
removeWebContext(javax.servlet.http.HttpServletRequest request)
将
RequestContext 对象和request脱离关联。 |
static void |
setWebContext(WebContext WebContext)
将
WebContext 对象和request相关联。 |
public static final String TINY_CONTEXT_PATH
public static final String TINY_REQUEST_URI
public static final String TINY_SERVLET_PATH
public static WebContext getWebContext(javax.servlet.http.HttpServletRequest request)
WebContext
对象。request
- 要检查的requestWebContext
对象,如果没找到,则返回null
public static void setWebContext(WebContext WebContext)
WebContext
对象和request相关联。WebContext
- WebContext
对象public static void removeWebContext(javax.servlet.http.HttpServletRequest request)
RequestContext
对象和request脱离关联。public static <R extends WebContext> R findWebContext(javax.servlet.http.HttpServletRequest request, Class<R> WebContextInterface)
request
- 从该HttpServletRequest
中取得request contextWebContextInterface
- 要查找的类WebContext
对象,如果没找到,则返回null
public static <R extends WebContext> R findWebContext(WebContext webContext, Class<R> webContextInterface)
webContext
- 要搜索的request contextwebContextInterface
- 要查找的类WebContext
对象,如果没找到,则返回null
public static void registerRequestDestructionCallback(String name, Runnable callback)
ServletRequestAttributes
中的析构回调方法,这些方法将在request
context被提交之后依次调用。public static String getServletPath(javax.servlet.http.HttpServletRequest request)
Copyright © 2006–2018 TinyGroup. All rights reserved.