org.springframework.web.servlet.DispatcherServlet .
Supports lookup of current WebApplicationContext, LocaleResolver, Locale, ThemeResolver, Theme, and MultipartResolver.
RequestContext, org.springframework.web.servlet.DispatcherServlet
| Modifier and Type | Field and Description |
|---|---|
| public static final String | REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME
The name of the bean to use to determine if an implementation of
|
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static WebApplicationContext | Returns: the request-specific WebApplicationContext, or the global one if no request-specific context has been found, ornull if nonecurrent HTTP request request, ServletContext current servlet context servletContext)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. |
| public static WebApplicationContext | Returns: the request-specific WebApplicationContext, or the global one if no request-specific context has been found, ornull if nonecurrent HTTP request request)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. |
| public static FlashMapManager | getFlashMapManager(HttpServletRequest
the current request request)Return the |
| public static Map | Returns: a read-only Map, ornull if not foundcurrent request request)Return read-only "input" flash attributes from request before redirect. |
| public static Locale | Returns: the current locale for the given request, either from the LocaleResolver or from the plain request itselfcurrent HTTP request request)Retrieve the current locale from the given request, using the
|
| public static LocaleResolver | Returns: the currentLocaleResolver, or null if not foundcurrent HTTP request request)Return the |
| public static FlashMap | getOutputFlashMap(HttpServletRequest
current request request)Return "output" FlashMap to save attributes for request after redirect. |
| public static Theme | Returns: the current theme, ornull if not foundcurrent HTTP request request)
Deprecated
since 6.0. as of 6.0, with no direct replacement
Retrieve the current theme from the given request, using the ThemeResolver and ThemeSource bound to the request by the DispatcherServlet. |
| public static ThemeResolver | Returns: the current ThemeResolver, ornull if not foundcurrent HTTP request request)
Deprecated
since 6.0. as of 6.0, with no direct replacement
Return the ThemeResolver that has been bound to the request by the DispatcherServlet. |
| public static ThemeSource | Returns: the current ThemeSourcecurrent HTTP request request)
Deprecated
since 6.0. as of 6.0, with no direct replacement
Return the ThemeSource that has been bound to the request by the DispatcherServlet. |
| public static TimeZone | Returns: the current time zone for the given request, either from theTimeZoneAwareLocaleContext or null if none associatedcurrent HTTP request request)Retrieve the current time zone from the given request, using the
|
| public static void | saveOutputFlashMap(String
the target URL for the redirect location, HttpServletRequest the current request request, HttpServletResponse the current response response)Convenience method that retrieves the |
| REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME | back to summary |
|---|---|
| public static final String REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME The name of the bean to use to determine if an implementation of
| |
| RequestContextUtils | back to summary |
|---|---|
| public RequestContextUtils() | |
| findWebApplicationContext | back to summary |
|---|---|
| public static WebApplicationContext findWebApplicationContext(HttpServletRequest request, ServletContext servletContext) 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. The global context will be found via the ServletContext or via ContextLoader's current context. Note This variant remains compatible with Servlet 2.5, explicitly checking a given ServletContext instead of deriving it from the request.
| |
| findWebApplicationContext | back to summary |
|---|---|
| public static WebApplicationContext findWebApplicationContext(HttpServletRequest request) 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. The global context will be found via the ServletContext or via ContextLoader's current context.
| |
| getFlashMapManager | back to summary |
|---|---|
| public static FlashMapManager getFlashMapManager(HttpServletRequest request) Return the As of 5.0 the convenience method
| |
| getInputFlashMap | back to summary |
|---|---|
| public static Map Return read-only "input" flash attributes from request before redirect.
| |
| getLocale | back to summary |
|---|---|
| public static Locale getLocale(HttpServletRequest request) Retrieve the current locale from the given request, using the
This method serves as a straightforward alternative to the standard
Servlet Consider using
| |
| getLocaleResolver | back to summary |
|---|---|
| public static LocaleResolver getLocaleResolver(HttpServletRequest request) Return the
| |
| getOutputFlashMap | back to summary |
|---|---|
| public static FlashMap getOutputFlashMap(HttpServletRequest request) Return "output" FlashMap to save attributes for request after redirect.
| |
| getTheme | back to summary |
|---|---|
| public static Theme getTheme(HttpServletRequest request)
Deprecated since 6.0. as of 6.0, with no direct replacement Retrieve the current theme from the given request, using the ThemeResolver and ThemeSource bound to the request by the DispatcherServlet.
| |
| getThemeResolver | back to summary |
|---|---|
| public static ThemeResolver getThemeResolver(HttpServletRequest request)
Deprecated since 6.0. as of 6.0, with no direct replacement Return the ThemeResolver that has been bound to the request by the DispatcherServlet.
| |
| getThemeSource | back to summary |
|---|---|
| public static ThemeSource getThemeSource(HttpServletRequest request)
Deprecated since 6.0. as of 6.0, with no direct replacement Return the ThemeSource that has been bound to the request by the DispatcherServlet.
| |
| getTimeZone | back to summary |
|---|---|
| public static TimeZone getTimeZone(HttpServletRequest request) Retrieve the current time zone from the given request, using the
Note This method returns Consider using
| |
| saveOutputFlashMap | back to summary |
|---|---|
| public static void saveOutputFlashMap(String location, HttpServletRequest request, HttpServletResponse response) Convenience method that retrieves the
| |