[bs-132] Actuator should use delegating version of MVC support

The delegating version delegates to other configurers, and it's what
@EnableWebMvc uses.  You effectively switch off the delegation if you
use the base class by mistake.

[Fixes #50267017] [bs-132] Static resources in /css/**
cannot be served by Actuator project
This commit is contained in:
Dave Syer
2013-05-22 18:23:25 +01:00
parent 29a81b8795
commit 5f7f69ad93
3 changed files with 8 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.servlet.DispatcherServlet;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration;
import com.fasterxml.jackson.databind.SerializationFeature;
@@ -34,7 +34,7 @@ import com.fasterxml.jackson.databind.SerializationFeature;
*/
@ConditionalOnClass({ Servlet.class, DispatcherServlet.class })
@Configuration
public class ActuatorWebConfiguration extends WebMvcConfigurationSupport {
public class ActuatorWebConfiguration extends DelegatingWebMvcConfiguration {
@Override
protected void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
@@ -46,6 +46,7 @@ public class ActuatorWebConfiguration extends WebMvcConfigurationSupport {
SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
}
}
super.configureMessageConverters(converters);
}
}