Spring 如何在web.xml中设置要筛选的order MIN_值?

Spring 如何在web.xml中设置要筛选的order MIN_值?,spring,spring-boot,spring-security,web.xml,servlet-filters,Spring,Spring Boot,Spring Security,Web.xml,Servlet Filters,我有这样一个自定义过滤器: @Bean 公共筛选器注册bean captchaFilter(){ FilterRegistrationBean registration=新的FilterRegistrationBean(新的CaptCharFilter()); registration.addUrlPatterns(“/login”); 注册。设置顺序(整数。最小值); 注册。设置名称(“captchaFilter”); 申报登记; } 我想把这个过滤器放在我的web.xml(没有Spring

我有这样一个自定义过滤器:

@Bean
公共筛选器注册bean captchaFilter(){
FilterRegistrationBean registration=新的FilterRegistrationBean(新的CaptCharFilter());
registration.addUrlPatterns(“/login”);
注册。设置顺序(整数。最小值);
注册。设置名称(“captchaFilter”);
申报登记;
}

我想把这个过滤器放在我的
web.xml
(没有Spring Boot)中,但是我如何设置这个过滤器的顺序呢?我想将order设置为
MIN\u VALUE
,因为我想在web.xml中的
springSecurityFilterChain

过滤器按照声明的顺序执行之前完成这项工作。只需在安全过滤器之前添加过滤器。。。无需订购。@M.Deinum嗨,谢谢。它无法正常工作,因为springSecurityFilterChain的顺序值较低。顺序与此无关。如前所述,web.xml中的筛选器执行顺序定义如下。。。弹簧的任何订购都不会影响这一点。