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对象,如果没找到,则返回nullpublic 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对象,如果没找到,则返回nullpublic static <R extends WebContext> R findWebContext(WebContext webContext, Class<R> webContextInterface)
webContext - 要搜索的request contextwebContextInterface - 要查找的类WebContext对象,如果没找到,则返回nullpublic 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.