From ce728a6c4bdd80674ffcab306c10fcc3af717a8c Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Thu, 18 Jun 2020 21:16:21 +0100 Subject: [PATCH] Update docs for PathPattern support in WebMvc Closes gh-24945 --- .../web/util/pattern/PathPattern.java | 9 +- src/docs/asciidoc/web/webmvc.adoc | 119 ++++++++---------- 2 files changed, 55 insertions(+), 73 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/web/util/pattern/PathPattern.java b/spring-web/src/main/java/org/springframework/web/util/pattern/PathPattern.java index 84b409b168f..0b69eed122e 100644 --- a/spring-web/src/main/java/org/springframework/web/util/pattern/PathPattern.java +++ b/spring-web/src/main/java/org/springframework/web/util/pattern/PathPattern.java @@ -47,9 +47,12 @@ import org.springframework.util.StringUtils; * and captures it as a variable named "spring" * * - * Notable behavior difference with {@code AntPathMatcher}:
- * {@code **} and its capturing variant {*spring} cannot be used in the middle of a pattern - * string, only at the end: {@code /pages/{**}} is valid, but {@code /pages/{**}/details} is not. + *

Note: In contrast to + * {@link org.springframework.util.AntPathMatcher}, {@code **} is supported only + * at the end of a pattern. For example {@code /pages/{**}} is valid but + * {@code /pages/{**}/details} is not. The same applies also to the capturing + * variant {*spring}. The aim is to eliminate ambiguity when + * comparing patterns for specificity. * *

Examples

*