Class 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
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
static directory which contains all static assets like CSS files, JavaScript files and images and
login page. Note that filter will automatically add redirectUrls entry to list of excluded
URLs. Additionally filter sets request attribute initialized to TRUE or FALSE
depending 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>
-
Field Summary
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger -
Constructor Summary
ConstructorsConstructorDescriptionRedirectWhenSystemIsNotInitializedFilter(String defaultRedirectUrl) RedirectWhenSystemIsNotInitializedFilter(Map<String, String> redirectUrls) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain) Methods inherited from class de.hybris.platform.servicelayer.web.AbstractCheckedUriFilter
getUrlPaths, isUrlPathsContainsUri, setUrlPathsMethods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Constructor Details
-
RedirectWhenSystemIsNotInitializedFilter
-
RedirectWhenSystemIsNotInitializedFilter
-
-
Method Details
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain) throws IOException, javax.servlet.ServletException - Throws:
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
-