Class RedirectWhenSystemIsNotInitializedFilter
- java.lang.Object
-
- org.springframework.web.filter.GenericFilterBean
-
- de.hybris.platform.servicelayer.web.AbstractCheckedUriFilter
-
- de.hybris.platform.servicelayer.web.RedirectWhenSystemIsNotInitializedFilter
-
- 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 RedirectWhenSystemIsNotInitializedFilter extends AbstractCheckedUriFilter
Filter which takes care of redirection of the current request in case the system will be recognized as not initialized. Filter Spring configuration requires redirect URL map to which request is redirected to and optionally list of excluded URLs for which redirecting will not work. You are able to provide a specific for tenant redirect url in case system is not initialized. Ther is a DEFAULT entry which will be used to redirect if no specific url found for current tenant id. In standard web application list of excluded URLs will contain for instance
Sample configuration:staticdirectory which contains all static assets like CSS files, JavaScript files and images andloginpage. Note that filter will automatically addredirectUrlsentry to list of excluded URLs. Additionally filter sets request attributeinitializedtoTRUEorFALSEdepending on initialization status.<bean id="redirectFilter" class="de.hybris.platform.servicelayer.web.RedirectWhenSystemIsNotInitializedFilter" scope="tenant"> <constructor-arg> <util:map> <entry key="DEFAULT" value="/platform/init"/> <entry key="junit" value="/test"/> </util:map> </constructor-arg> <property name="urlPaths"> <list> <value>login</value> <value>static</value> </list> </property> </bean>
-
-
Constructor Summary
Constructors Constructor Description RedirectWhenSystemIsNotInitializedFilter(java.lang.String defaultRedirectUrl)RedirectWhenSystemIsNotInitializedFilter(java.util.Map<java.lang.String,java.lang.String> redirectUrls)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain)-
Methods inherited from class de.hybris.platform.servicelayer.web.AbstractCheckedUriFilter
getUrlPaths, isUrlPathsContainsUri, setUrlPaths
-
-
-
-
Method Detail
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain) throws java.io.IOException, javax.servlet.ServletException- Throws:
java.io.IOExceptionjavax.servlet.ServletException
-
afterPropertiesSet
public void afterPropertiesSet() throws javax.servlet.ServletException- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classorg.springframework.web.filter.GenericFilterBean- Throws:
javax.servlet.ServletException
-
-