diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java index a8f615818646..2a8669c2d1dc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java @@ -251,10 +251,6 @@ public void checkConfiguration() { throw new IncompatibleConfigurationException("spring.mvc.pathmatch.matching-strategy", "spring.mvc.pathmatch.use-registered-suffix-pattern"); } - if (!this.getServlet().getServletMapping().equals("/")) { - throw new IncompatibleConfigurationException("spring.mvc.pathmatch.matching-strategy", - "spring.mvc.servlet.path"); - } } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcPropertiesTests.java index 14d73ec53b02..9370cdb5778e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcPropertiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,14 +80,6 @@ void incompatiblePathMatchRegisteredSuffixConfig() { .isThrownBy(this.properties::checkConfiguration); } - @Test - void incompatiblePathMatchServletPathConfig() { - this.properties.getPathmatch().setMatchingStrategy(WebMvcProperties.MatchingStrategy.PATH_PATTERN_PARSER); - this.properties.getServlet().setPath("/test"); - assertThatExceptionOfType(IncompatibleConfigurationException.class) - .isThrownBy(this.properties::checkConfiguration); - } - private void bind(String name, String value) { bind(Collections.singletonMap(name, value)); }