Added scenario using FooPageableLiveTest bean
This commit is contained in:
parent
52b164ffca
commit
1e9efcd606
@ -2,6 +2,7 @@ package com.baeldung.spring;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.ImportResource;
|
import org.springframework.context.annotation.ImportResource;
|
||||||
@ -35,26 +36,34 @@ public class WebConfig implements WebMvcConfigurer {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// Another possibility is to create a bean which will be automatically added to the Spring Boot Autoconfigurations
|
// Another possibility is to create a bean which will be automatically added to the Spring Boot Autoconfigurations
|
||||||
// @Bean
|
// @Bean
|
||||||
// public HttpMessageConverter<Object> createXmlHttpMessageConverter() {
|
// public HttpMessageConverter<Object> createXmlHttpMessageConverter() {
|
||||||
// final MarshallingHttpMessageConverter xmlConverter = new MarshallingHttpMessageConverter();
|
// final MarshallingHttpMessageConverter xmlConverter = new MarshallingHttpMessageConverter();
|
||||||
//
|
//
|
||||||
// final XStreamMarshaller xstreamMarshaller = new XStreamMarshaller();
|
// final XStreamMarshaller xstreamMarshaller = new XStreamMarshaller();
|
||||||
// xstreamMarshaller.setAutodetectAnnotations(true);
|
// xstreamMarshaller.setAutodetectAnnotations(true);
|
||||||
// xmlConverter.setMarshaller(xstreamMarshaller);
|
// xmlConverter.setMarshaller(xstreamMarshaller);
|
||||||
// xmlConverter.setUnmarshaller(xstreamMarshaller);
|
// xmlConverter.setUnmarshaller(xstreamMarshaller);
|
||||||
//
|
//
|
||||||
// return xmlConverter;
|
// return xmlConverter;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
// Etags
|
// Etags
|
||||||
|
|
||||||
// If we're not using Spring Boot we can make use of
|
// If we're not using Spring Boot we can make use of
|
||||||
// AbstractAnnotationConfigDispatcherServletInitializer#getServletFilters
|
// AbstractAnnotationConfigDispatcherServletInitializer#getServletFilters
|
||||||
@Bean
|
@Bean
|
||||||
public ShallowEtagHeaderFilter shallowEtagHeaderFilter() {
|
public FilterRegistrationBean<ShallowEtagHeaderFilter> shallowEtagHeaderFilter() {
|
||||||
return new ShallowEtagHeaderFilter();
|
FilterRegistrationBean<ShallowEtagHeaderFilter> filterRegistrationBean = new FilterRegistrationBean<>( new ShallowEtagHeaderFilter());
|
||||||
|
filterRegistrationBean.addUrlPatterns("/auth/foos/*");
|
||||||
|
filterRegistrationBean.setName("etagFilter");
|
||||||
|
return filterRegistrationBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We can also just declare the filter directly
|
||||||
|
// @Bean
|
||||||
|
// public ShallowEtagHeaderFilter shallowEtagHeaderFilter() {
|
||||||
|
// return new ShallowEtagHeaderFilter();
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user