| java.lang.Object org.springframework.web.servlet.support.RequestContextUtils
RequestContextUtils | abstract public class RequestContextUtils (Code) | | Utility class for easy access to request-specific state
which has been set by the DispatcherServlet.
Supports lookup of current WebApplicationContext, LocaleResolver,
Locale, ThemeResolver, Theme, and MultipartResolver.
author: Juergen Hoeller since: 03.03.2003 See Also: RequestContext See Also: org.springframework.web.servlet.DispatcherServlet |
getLocaleResolver | public static LocaleResolver getLocaleResolver(HttpServletRequest request)(Code) | | Return the LocaleResolver that has been bound to the request by the
DispatcherServlet.
Parameters: request - current HTTP request the current LocaleResolver, or null if not found |
getTheme | public static Theme getTheme(HttpServletRequest request)(Code) | | Retrieves the current theme from the given request, using the ThemeResolver
and ThemeSource bound to the request by the DispatcherServlet.
Parameters: request - current HTTP request the current theme, or null if not found See Also: RequestContextUtils.getThemeResolver |
getThemeResolver | public static ThemeResolver getThemeResolver(HttpServletRequest request)(Code) | | Return the ThemeResolver that has been bound to the request by the
DispatcherServlet.
Parameters: request - current HTTP request the current ThemeResolver, or null if not found |
getThemeSource | public static ThemeSource getThemeSource(HttpServletRequest request)(Code) | | Return the ThemeSource that has been bound to the request by the
DispatcherServlet.
Parameters: request - current HTTP request the current ThemeSource |
getWebApplicationContext | public static WebApplicationContext getWebApplicationContext(ServletRequest request) throws IllegalStateException(Code) | | Look for the WebApplicationContext associated with the DispatcherServlet
that has initiated request processing.
Parameters: request - current HTTP request the request-specific web application context throws: IllegalStateException - if no servlet-specific context has been found |
getWebApplicationContext | public static WebApplicationContext getWebApplicationContext(ServletRequest request, ServletContext servletContext) throws IllegalStateException(Code) | | Look for the WebApplicationContext associated with the DispatcherServlet
that has initiated request processing, and for the global context if none
was found associated with the current request. This method is useful to
allow components outside the framework, such as JSP tag handlers,
to access the most specific application context available.
Parameters: request - current HTTP request Parameters: servletContext - current servlet context the request-specific WebApplicationContext, or the global oneif no request-specific context has been found throws: IllegalStateException - if neither a servlet-specific nor aglobal context has been found |
|
|