abstract class RequestContextUtils
Utility class for easy access to request-specific state which has been set by the org.springframework.web.servlet.DispatcherServlet.
Supports lookup of current WebApplicationContext, LocaleResolver, Locale, ThemeResolver, Theme, and MultipartResolver.
Author
Juergen Hoeller
Author
Rossen Stoyanchev
Since
03.03.2003
See Also
RequestContextorg.springframework.web.servlet.DispatcherServlet
RequestContextUtils()
Utility class for easy access to request-specific state which has been set by the org.springframework.web.servlet.DispatcherServlet. Supports lookup of current WebApplicationContext, LocaleResolver, Locale, ThemeResolver, Theme, and MultipartResolver. |
static val REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME: String
The name of the bean to use to look up in an implementation of RequestDataValueProcessor has been configured. |
open static fun findWebApplicationContext(request: HttpServletRequest, servletContext: ServletContext): WebApplicationContext
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. open static fun findWebApplicationContext(request: HttpServletRequest): WebApplicationContext
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 requires Servlet 3.0+ and is generally recommended for forward-looking custom user code. |
|
open static fun getFlashMapManager(request: HttpServletRequest): FlashMapManager
Return the As of 5.0 the convenience method |
|
open static fun getInputFlashMap(request: HttpServletRequest): MutableMap<String, *>
Return read-only "input" flash attributes from request before redirect. |
|
open static fun getLocale(request: HttpServletRequest): Locale
Retrieve the current locale from the given request, using the LocaleResolver bound to the request by the DispatcherServlet (if available), falling back to the request's accept-header Locale. This method serves as a straightforward alternative to the standard Servlet Consider using |
|
open static fun getLocaleResolver(request: HttpServletRequest): LocaleResolver
Return the LocaleResolver that has been bound to the request by the DispatcherServlet. |
|
open static fun getOutputFlashMap(request: HttpServletRequest): FlashMap
Return "output" FlashMap to save attributes for request after redirect. |
|
open static fun getTheme(request: HttpServletRequest): Theme
Retrieves the current theme from the given request, using the ThemeResolver and ThemeSource bound to the request by the DispatcherServlet. |
|
open static fun getThemeResolver(request: HttpServletRequest): ThemeResolver
Return the ThemeResolver that has been bound to the request by the DispatcherServlet. |
|
open static fun getThemeSource(request: HttpServletRequest): ThemeSource
Return the ThemeSource that has been bound to the request by the DispatcherServlet. |
|
open static fun getTimeZone(request: HttpServletRequest): TimeZone
Retrieve the current time zone from the given request, using the TimeZoneAwareLocaleResolver bound to the request by the DispatcherServlet (if available), falling back to the system's default time zone. Note: This method returns Consider using |
|
open static fun saveOutputFlashMap(location: String, request: HttpServletRequest, response: HttpServletResponse): Unit
Convenience method that retrieves the |