Skip to Content
Former Member
Jul 01, 2014 at 03:14 PM

Order of execution of filters is not working - javax.servlet.Filter, de.hybris.platform.servicelayer.web.PlatformFilterChain



We are encountering a strange issue with the order in which the filters are getting triggered in our web application.

We are integrating a sitemesh filter in our application and we are seeing issues with the spring security tags in the decorator pages. This is happening because the springSecurityFilterChain is executing after the sitemesh filter.

In our web.xml we have the following:



where storefrontTenantFilterchain is declared as a spring delegatingFilterProxy


bean definition:

             <ref bean="storefrontSessionFilter" />
             <ref bean="springSecurityFilterChain" />                

and the sitemesh filter is just a regular javax.servlet.Filter implementation

These filters should be triggering in the order in which they are declared in the web.xml




This is not happening. I am setting some breakpoints to track the order of execution and the sitemesh filter is executing before the fdStorefrontTenantFilterChain (the one that references the springSecurityFilterChain)

Unfortunately declaring the sitemesh filter as bean and adding this to the constructor list of the PlatformFilterChain is not an option due to some custom initialization in the public void init(FilterConfig filterConfig)

Is there something that I'm missing? I've tried many different things and the only thing that worked was using the de.hybris.platform.util.HybrisInitFilter (which is deprecated) and moving the springSecurityFilterChain to the web.xml but this is breaking some other functionality.

Thanks in advance for your response.