I have the following piece of code in my initializer:
public class AppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Filter[] getServletFilters() {
DelegatingFilterProxy shiroFilter = new DelegatingFilterProxy("shiroFilter");
shiroFilter.setTargetFilterLifecycle(true);
return new Filter[]{new CorsFilter(),shiroFilter};
}
}
I want CorsFilter
to be executed before ShiroFilter
. However, the Spring documentation doesn't say that the order in which the filters are executed is determined by their order in the returned array.
If it is, can someone please clarify it? If not, can someone suggest how do I guarantee the execution order of filters?