public class SitePreferenceRequestFilter extends 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.ALREADY_FILTERED_SUFFIX
logger
Constructor and Description |
---|
SitePreferenceRequestFilter() |
SitePreferenceRequestFilter(SitePreferenceHandler sitePreferenceHandler) |
Modifier and Type | Method and Description |
---|---|
protected void |
doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain filterChain) |
doFilter, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
public SitePreferenceRequestFilter()
public SitePreferenceRequestFilter(SitePreferenceHandler sitePreferenceHandler)
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException
doFilterInternal
in class OncePerRequestFilter
ServletException
IOException