SpringBoot项目,引入了两个Jar包,两个包中分别有一个Filter,请教各位同学,怎么在自己的项目中去变更这两个Filter的顺序啊?
两个Filter都是在jar包中通过@Configuration写配置类注册进去的,如下面代码所示
@Bean
public FilterRegistrationBean myFilter() {
FilterRegistrationBean registration = new FilterRegistrationBean();
registration.setFilter(new MyFilter());
registration.addUrlPatterns(new String[]{"/*"});
registration.setOrder(-10);
registration.setName("myFilter");
return registration;
}