From e766c8b3a733a527b11c06de2485d0c27c2265fb Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 7 Apr 2021 15:17:02 -0700 Subject: [PATCH] Revert "Switch default MVC path matching strategy" This reverts commit ab8e599cfedd6d626daaee65fc86d8c0ae470d16. See gh-24805 --- .../boot/autoconfigure/web/servlet/WebMvcProperties.java | 2 +- .../web/servlet/WebMvcAutoConfigurationTests.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) 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 5f53ea2a6165..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 @@ -434,7 +434,7 @@ public static class Pathmatch { /** * Choice of strategy for matching request paths against registered mappings. */ - private MatchingStrategy matchingStrategy = MatchingStrategy.PATH_PATTERN_PARSER; + private MatchingStrategy matchingStrategy = MatchingStrategy.ANT_PATH_MATCHER; /** * 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 e9c314fc0370..3e929144d28a 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 @@ -849,8 +849,7 @@ void defaultPathMatching() { @Deprecated @SuppressWarnings("deprecation") void useSuffixPatternMatch() { - this.contextRunner.withPropertyValues("spring.mvc.pathmatch.matching-strategy=ant-path-matcher", - "spring.mvc.pathmatch.use-suffix-pattern:true", + this.contextRunner.withPropertyValues("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();