From 5f7f69ad9308fc7497b8ab3d00fe30eb9f947091 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Wed, 22 May 2013 18:23:25 +0100 Subject: [PATCH] [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 --- .../actuate/autoconfigure/ActuatorWebConfiguration.java | 5 +++-- spring-bootstrap-samples/spring-bootstrap-ui-sample/pom.xml | 5 +++++ .../src/test/resources/logging.properties | 1 - 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/spring-bootstrap-actuator/src/main/java/org/springframework/bootstrap/actuate/autoconfigure/ActuatorWebConfiguration.java b/spring-bootstrap-actuator/src/main/java/org/springframework/bootstrap/actuate/autoconfigure/ActuatorWebConfiguration.java index 68fe122e4b..314937d5a3 100644 --- a/spring-bootstrap-actuator/src/main/java/org/springframework/bootstrap/actuate/autoconfigure/ActuatorWebConfiguration.java +++ b/spring-bootstrap-actuator/src/main/java/org/springframework/bootstrap/actuate/autoconfigure/ActuatorWebConfiguration.java @@ -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> converters) { @@ -46,6 +46,7 @@ public class ActuatorWebConfiguration extends WebMvcConfigurationSupport { SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); } } + super.configureMessageConverters(converters); } } diff --git a/spring-bootstrap-samples/spring-bootstrap-ui-sample/pom.xml b/spring-bootstrap-samples/spring-bootstrap-ui-sample/pom.xml index 00a471ae06..6a9c8109fc 100644 --- a/spring-bootstrap-samples/spring-bootstrap-ui-sample/pom.xml +++ b/spring-bootstrap-samples/spring-bootstrap-ui-sample/pom.xml @@ -18,6 +18,11 @@ spring-bootstrap ${project.version} + + ${project.groupId} + spring-bootstrap-actuator + ${project.version} + org.springframework spring-webmvc diff --git a/spring-bootstrap-samples/spring-bootstrap-ui-sample/src/test/resources/logging.properties b/spring-bootstrap-samples/spring-bootstrap-ui-sample/src/test/resources/logging.properties index 4ee91efbaa..4c989d9a9b 100644 --- a/spring-bootstrap-samples/spring-bootstrap-ui-sample/src/test/resources/logging.properties +++ b/spring-bootstrap-samples/spring-bootstrap-ui-sample/src/test/resources/logging.properties @@ -4,4 +4,3 @@ handlers = java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level = FINE sun.net.www.protocol.http.HttpURLConnection.level = ALL org.springframework.bootstrap.context.annotation.level = ALL -org.thymeleaf.level = ALL \ No newline at end of file