java.lang.Object | |
↳ | org.springframework.web.servlet.support.RequestContextUtils |
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.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Retrieves 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.
| |||||||||||
Return the LocaleResolver that has been bound to the request by the
DispatcherServlet.
| |||||||||||
Retrieves the current theme from the given request, using the ThemeResolver
and ThemeSource bound to the request by the DispatcherServlet.
| |||||||||||
Return the ThemeResolver that has been bound to the request by the
DispatcherServlet.
| |||||||||||
Return the ThemeSource that has been bound to the request by the
DispatcherServlet.
| |||||||||||
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.
| |||||||||||
Look for the WebApplicationContext associated with the DispatcherServlet
that has initiated request processing.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Retrieves 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.
request | current HTTP request |
---|
Return the LocaleResolver that has been bound to the request by the DispatcherServlet.
request | current HTTP request |
---|
null
if not found
Retrieves the current theme from the given request, using the ThemeResolver and ThemeSource bound to the request by the DispatcherServlet.
request | current HTTP request |
---|
null
if not foundReturn the ThemeResolver that has been bound to the request by the DispatcherServlet.
request | current HTTP request |
---|
null
if not found
Return the ThemeSource that has been bound to the request by the DispatcherServlet.
request | current HTTP 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. This method is useful to allow components outside the framework, such as JSP tag handlers, to access the most specific application context available.
request | current HTTP request |
---|---|
servletContext | current servlet context |
IllegalStateException | if neither a servlet-specific nor a global context has been found |
---|
Look for the WebApplicationContext associated with the DispatcherServlet that has initiated request processing.
request | current HTTP request |
---|
IllegalStateException | if no servlet-specific context has been found |
---|