Class BaseSiteFilter
- java.lang.Object
-
- org.springframework.web.filter.GenericFilterBean
-
- org.springframework.web.filter.OncePerRequestFilter
-
- de.hybris.platform.ycommercewebservices.filter.BaseSiteFilter
-
- All Implemented Interfaces:
javax.servlet.Filter,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.EnvironmentAware,org.springframework.core.env.EnvironmentCapable,org.springframework.web.context.ServletContextAware
public class BaseSiteFilter extends org.springframework.web.filter.OncePerRequestFilterRequest filter that resolves base site uid from restful request mapping, i.e
/rest/v1/mysite/cart, or
/rest/v1/mysite/customers/current
would try to set base site with uid=mysite as a current site.
One should define the path which is expected to be before the site resource in the project properties file (commercewebservices.rootcontext).
Default and fallback value equals to /rest/v1/
The method uses also a comma separated list of url special characters that are used to parse the site id resource. You can reconfigure it in properties file (commercewebservices.url.special.characters). The default and fallback value is equal to "?,/". Filter will throwServletExceptionif it fails to find the site which is in the resource url.
However, you can configure exceptions that doesnt require the site mapping in the resource path. You can configure them in a spring bean called 'baseFilterResourceExceptions'.
-
-
Constructor Summary
Constructors Constructor Description BaseSiteFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain)ContextInformationLoadergetContextInformationLoader()protected voidprocessRequest(javax.servlet.http.HttpServletRequest httpRequest)voidsetContextInformationLoader(ContextInformationLoader contextInformationLoader)-
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
-
-
-
-
Method Detail
-
doFilterInternal
protected void doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain) throws javax.servlet.ServletException, java.io.IOException- Specified by:
doFilterInternalin classorg.springframework.web.filter.OncePerRequestFilter- Throws:
javax.servlet.ServletExceptionjava.io.IOException
-
processRequest
protected void processRequest(javax.servlet.http.HttpServletRequest httpRequest) throws InvalidResourceException- Throws:
InvalidResourceException
-
getContextInformationLoader
public ContextInformationLoader getContextInformationLoader()
-
setContextInformationLoader
public void setContextInformationLoader(ContextInformationLoader contextInformationLoader)
-
-