public class SitePreferenceRequestFilter
extends org.springframework.web.filter.OncePerRequestFilter
SitePreferenceHandler to resolve the SitePreference of the user
that originated the web request. The resolved SitePreference is exported as a request attribute under the well-known
name of SitePreferenceHandler.CURRENT_SITE_PREFERENCE_ATTRIBUTE. Request handlers such as @Controllers and
views may then access the currentSitePreference to vary their control and rendering logic, respectively.
Note: do not use this filter in conjunction with the SiteSwitcherRequestFilter, as the switcher internally delegates
to a SitePreferenceHandler as part of its own workflow. This filter should only be used when site switching
is not needed but site preference management is still desired.| Constructor and Description |
|---|
SitePreferenceRequestFilter() |
SitePreferenceRequestFilter(SitePreferenceHandler sitePreferenceHandler) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doFilterInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain filterChain) |
doFilter, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatchpublic SitePreferenceRequestFilter()
public SitePreferenceRequestFilter(SitePreferenceHandler sitePreferenceHandler)
protected void doFilterInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain filterChain)
throws javax.servlet.ServletException,
java.io.IOException
doFilterInternal in class org.springframework.web.filter.OncePerRequestFilterjavax.servlet.ServletExceptionjava.io.IOException