Class SiteLanguageInterceptor
java.lang.Object
com.hybris.merchandising.interceptors.SiteLanguageInterceptor
- All Implemented Interfaces:
org.springframework.web.servlet.HandlerInterceptor
public class SiteLanguageInterceptor
extends Object
implements org.springframework.web.servlet.HandlerInterceptor
Default interceptor to run before controllers' execution to extract the site-id from the request URI and to set the
current session value.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CMSAdminSiteServiceGets the configuredCMSAdminSiteServiceused to set what site we're currently using.protected BaseSiteServiceGets the configuredBaseSiteServiceused to set what site we're currently using.booleanpreHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) Adds the siteId to the session.voidsetAdminSiteService(CMSAdminSiteService adminSiteService) Sets the configuredCMSAdminSiteServiceused to set what site we're currently using.voidsetBaseSiteService(BaseSiteService baseSiteService) Sets the configuredBaseSiteServiceused to set what site we're currently using.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.servlet.HandlerInterceptor
afterCompletion, postHandle
-
Constructor Details
-
SiteLanguageInterceptor
public SiteLanguageInterceptor()
-
-
Method Details
-
preHandle
public boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) Adds the siteId to the session. When siteId is not valid, the current session siteId is set to null.- Specified by:
preHandlein interfaceorg.springframework.web.servlet.HandlerInterceptor
-
getBaseSiteService
Gets the configuredBaseSiteServiceused to set what site we're currently using.- Returns:
- baseSiteService the configured
BaseSiteService.
-
setBaseSiteService
Sets the configuredBaseSiteServiceused to set what site we're currently using.- Parameters:
baseSiteService- theBaseSiteServiceto set.
-
getAdminSiteService
Gets the configuredCMSAdminSiteServiceused to set what site we're currently using.- Returns:
- adminSiteService the configured
CMSAdminSiteService.
-
setAdminSiteService
Sets the configuredCMSAdminSiteServiceused to set what site we're currently using.- Parameters:
adminSiteService- the configuredCMSAdminSiteService.
-