I have the following code snippet 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 run before ShiroFilter . However, the Spring documentation does not indicate that the order in which filters are executed is determined by their order in the returned array.
If so, can someone clarify this? If not, can anyone suggest how I can guarantee the order in which the filters are executed?
java spring spring-java-config
pdeva
source share