I'm using Spring Boot 2.0.0.RELEASE.
I have the following configuration to proxy some static content:
@Configuration
class WebMvcConfiguration extends WebMvcConfigurationSupport {
@Value("${my.url}")
private String myUrl;
@Override
protected void addResourceHandlers(ResourceHandlerRegistry aRegistry) {
aRegistry.addResourceHandler("/some/path/**").addResourceLocations(myUrl);
}
}
But that seems to break my Jackson config:
spring.jackson.date-format=yyyy-MM-dd'T'HH:mm:ss'Z'
spring.jackson.serialization.write-date-keys-as-timestamps=false
on my controllers. i.e. dates are coming as long timestamps as opposed to formatted.
Spring Boot is taking your use of WebMvcConfigurationSupport as an indication that it shouldn't auto-configure Spring MVC. Try replacing extends WebMvcConfigurationSupport with implements WebMvcConfigurer instead.
works like a charm. thanks!
This feature took me whole day to find out why my Jackson setting not work :(
Maybe we should add some doc in the class or some warning about it.
Most helpful comment
Spring Boot is taking your use of
WebMvcConfigurationSupportas an indication that it shouldn't auto-configure Spring MVC. Try replacingextends WebMvcConfigurationSupportwithimplements WebMvcConfigurerinstead.