Skip to content

Commit e766c8b

Browse files
committed
Revert "Switch default MVC path matching strategy"
This reverts commit ab8e599. See gh-24805
1 parent ab8e599 commit e766c8b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ public static class Pathmatch {
434434
/**
435435
* Choice of strategy for matching request paths against registered mappings.
436436
*/
437-
private MatchingStrategy matchingStrategy = MatchingStrategy.PATH_PATTERN_PARSER;
437+
private MatchingStrategy matchingStrategy = MatchingStrategy.ANT_PATH_MATCHER;
438438

439439
/**
440440
* Whether to use suffix pattern match (".*") when matching patterns to requests.

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -849,8 +849,7 @@ void defaultPathMatching() {
849849
@Deprecated
850850
@SuppressWarnings("deprecation")
851851
void useSuffixPatternMatch() {
852-
this.contextRunner.withPropertyValues("spring.mvc.pathmatch.matching-strategy=ant-path-matcher",
853-
"spring.mvc.pathmatch.use-suffix-pattern:true",
852+
this.contextRunner.withPropertyValues("spring.mvc.pathmatch.use-suffix-pattern:true",
854853
"spring.mvc.pathmatch.use-registered-suffix-pattern:true").run((context) -> {
855854
RequestMappingHandlerMapping handlerMapping = context.getBean(RequestMappingHandlerMapping.class);
856855
assertThat(handlerMapping.useSuffixPatternMatch()).isTrue();

0 commit comments

Comments
 (0)