This commit is contained in:
Loredana Crusoveanu 2018-06-10 22:36:58 +03:00
parent 272497eaaf
commit 45b7401253
1 changed files with 9 additions and 9 deletions

View File

@ -6,12 +6,12 @@ import org.springframework.context.annotation.Configuration;
import com.baeldung.bootcustomfilters.filters.RequestResponseLoggingFilter; import com.baeldung.bootcustomfilters.filters.RequestResponseLoggingFilter;
// uncomment this and comment the @Component in the filter class definition to register only for a url pattern @Configuration
//@Configuration
public class FilterConfig { public class FilterConfig {
//@Bean // uncomment this and comment the @Component in the filter class definition to register only for a url pattern
public FilterRegistrationBean<RequestResponseLoggingFilter> loggingFilter(){ // @Bean
public FilterRegistrationBean<RequestResponseLoggingFilter> loggingFilter() {
FilterRegistrationBean<RequestResponseLoggingFilter> registrationBean = new FilterRegistrationBean<>(); FilterRegistrationBean<RequestResponseLoggingFilter> registrationBean = new FilterRegistrationBean<>();
registrationBean.setFilter(new RequestResponseLoggingFilter()); registrationBean.setFilter(new RequestResponseLoggingFilter());