package com.pgf.mqspring; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class AuthConfig { /** * フィルタ1のオブジェクトをコンポーネントに追加 * @return フィルタ1を登録したBean */ @Bean public FilterRegistrationBean < RequestAuthFilter > filterRegistrationBean() { FilterRegistrationBean < RequestAuthFilter > registrationBean = new FilterRegistrationBean(); RequestAuthFilter RequestAuthFilter = new RequestAuthFilter(); registrationBean.setFilter(RequestAuthFilter); registrationBean.addUrlPatterns("/pgf/*"); registrationBean.setOrder(1); //set precedence return registrationBean; } }