import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.HiddenHttpMethodFilter;
/**
* @ClassName @{NAME}
* @Description TODO
* @Author Administrator
* @Date 2019/1/10 11:14
* @Version 1.0
**/
@Configuration
public class StarsFilterConfiguration {
/*FilterRegistrationBean 用来配置urlpattern 来确定哪些路径触发filter */
@Bean
public FilterRegistrationBean registration(HiddenHttpMethodFilter filter) {
FilterRegistrationBean registration = new FilterRegistrationBean(filter);
registration.setEnabled(false);
registration.addUrlPatterns("/"); //controller mapping
return registration;
}
}