From b7ed5bbc76cb64a1d76267e395bdd7dda5fe6460 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Tue, 15 Oct 2013 10:16:29 -0400 Subject: [PATCH] Revert "Temporary fix for Spring snapshot changes" This reverts commit 8a804f61852100f82aa044c21f0ce6cf2d24bf8c. --- .../web/WebMvcAutoConfiguration.java | 16 ++++++++-------- .../web/WebMvcAutoConfigurationTests.java | 5 ----- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java index e5767c5479..d76f52896e 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java @@ -175,14 +175,14 @@ public class WebMvcAutoConfiguration { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { - // FIXME: re-instate this when Spring is updated - // if (!registry.hasMappingForPattern("/webjars/**")) { - registry.addResourceHandler("/webjars/**").addResourceLocations( - "classpath:/META-INF/resources/webjars/"); - // } - // if (!registry.hasMappingForPattern("/**")) { - registry.addResourceHandler("/**").addResourceLocations(RESOURCE_LOCATIONS); - // } + if (!registry.hasMappingForPattern("/webjars/**")) { + registry.addResourceHandler("/webjars/**").addResourceLocations( + "classpath:/META-INF/resources/webjars/"); + } + if (!registry.hasMappingForPattern("/**")) { + registry.addResourceHandler("/**").addResourceLocations( + RESOURCE_LOCATIONS); + } } @Override diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfigurationTests.java index 401344d545..fa0fb09782 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfigurationTests.java @@ -25,7 +25,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.junit.After; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -102,8 +101,6 @@ public class WebMvcAutoConfigurationTests { } @Test - @Ignore - // FIXME: re-instate when Spring is back to normal public void resourceHandlerMappingOverrideWebjars() throws Exception { this.context = new AnnotationConfigEmbeddedWebApplicationContext(); this.context.register(WebJars.class, Config.class, WebMvcAutoConfiguration.class); @@ -115,8 +112,6 @@ public class WebMvcAutoConfigurationTests { } @Test - @Ignore - // FIXME: re-instate when Spring is back to normal public void resourceHandlerMappingOverrideAll() throws Exception { this.context = new AnnotationConfigEmbeddedWebApplicationContext(); this.context.register(AllResources.class, Config.class,