This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/struts-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 18974a0b2 WW-5743 docs: the ** count is the first specificity key from 
7.4.0 (#340)
18974a0b2 is described below

commit 18974a0b2905cbf17260f27ad483eb3f7877f9ac
Author: Lukasz Lenart <[email protected]>
AuthorDate: Thu Sep 17 08:52:56 2026 +0200

    WW-5743 docs: the ** count is the first specificity key from 7.4.0 (#340)
    
    Matches apache/struts#1962: the Convention plugin's most-specific-first
    ordering now consults the path-spanning ** count before the wildcard-token
    and literal counts, so `a/*/*` ranks ahead of `a/**`. Keeps a note on the
    7.3.0 order for readers on that release.
    
    Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
---
 source/core-developers/wildcard-mappings.md | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/source/core-developers/wildcard-mappings.md 
b/source/core-developers/wildcard-mappings.md
index 5a83792cf..e0bd8c806 100644
--- a/source/core-developers/wildcard-mappings.md
+++ b/source/core-developers/wildcard-mappings.md
@@ -95,11 +95,15 @@ narrower one it also matches could therefore shadow it, 
non-deterministically 
 
 Annotated wildcard action names are now sorted most-specific-first before 
registration, using these keys in order:
 
-1. fewer wildcard tokens first (a `*` / `**` run, or a `{var}` group);
-2. more literal characters first;
-3. fewer path-spanning `**` tokens first;
+1. fewer path-spanning `**` tokens first — `**` crosses `/` while `*` and 
`{var}` never do, so a pattern that
+   relies on it is broader than one that does not (`a/*/*` therefore ranks 
ahead of `a/**`);
+2. fewer wildcard tokens first (a `*` / `**` run, or a `{var}` group);
+3. more literal characters first;
 4. alphabetical order of the pattern, as a deterministic tie-breaker.
 
+Struts 7.3.0 applied the `**` key third, after the wildcard-token and literal 
counts, so `a/**` could shadow
+`a/*/*`; 7.4.0 lifts it to the first key 
([WW-5743](https://issues.apache.org/jira/browse/WW-5743)).
+
 The comparison recognises both `*` / `**` (the default `WildcardHelper` 
matcher) and `{var}`
 (`NamedVariablePatternMatcher`). XML mappings are unaffected — they keep their 
declared order.
 

Reply via email to