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 240e78074435..086ce6a60635 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 @@ -401,7 +401,7 @@ public static class Pathmatch { /** * Choice of strategy for matching request paths against registered mappings. */ - private MatchingStrategy matchingStrategy = MatchingStrategy.ANT_PATH_MATCHER; + private MatchingStrategy matchingStrategy = MatchingStrategy.PATH_PATTERN_PARSER; /** * Whether to use suffix pattern match (".*") when matching patterns to requests. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java index 39e6e92bdb72..f4a438d1d0d2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java @@ -837,7 +837,8 @@ void defaultPathMatching() { @Test @Deprecated void useSuffixPatternMatch() { - this.contextRunner.withPropertyValues("spring.mvc.pathmatch.use-suffix-pattern:true", + this.contextRunner.withPropertyValues("spring.mvc.pathmatch.matching-strategy=ant-path-matcher", + "spring.mvc.pathmatch.use-suffix-pattern:true", "spring.mvc.pathmatch.use-registered-suffix-pattern:true").run((context) -> { RequestMappingHandlerMapping handlerMapping = context.getBean(RequestMappingHandlerMapping.class); assertThat(handlerMapping.useSuffixPatternMatch()).isTrue();