Reinstate use of hasMappingForPattern

Use of hasMappingForPattern was commented out during work on the
Aether-based Grape implementation as it was temporarily removed in 
Spring 4's snapshots. It's since been reinstated in the snapshots, so
its use should have been reinstated prior to merging Aether work into
master.
This commit is contained in:
Andy Wilkinson
2013-10-22 17:17:07 +01:00
parent da748656ba
commit e5e511fd43
2 changed files with 8 additions and 9 deletions

View File

@@ -175,13 +175,14 @@ public class WebMvcAutoConfiguration {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
// 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

View File

@@ -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;
@@ -57,7 +56,6 @@ import static org.junit.Assert.assertThat;
* @author Phillip Webb
* @author Dave Syer
*/
@Ignore
public class WebMvcAutoConfigurationTests {
private static final MockEmbeddedServletContainerFactory containerFactory = new MockEmbeddedServletContainerFactory();