lukaszlenart opened a new pull request, #1614:
URL: https://github.com/apache/struts/pull/1614

   ## Summary
   
   Fixes [WW-2963](https://issues.apache.org/jira/browse/WW-2963)
   
   - `default-action-ref` fallback now resolves via wildcard matching when the 
exact action map lookup fails
   - Mirrors the exact→wildcard resolution pattern already used for request 
action names (3 lines added)
   - Adds three tests covering exact-match default-action-ref, wildcard-match 
default-action-ref, and no-match fallback
   
   ## Root Cause
   
   In 
`DefaultConfiguration.RuntimeConfigurationImpl.findActionConfigInNamespace()`, 
the default-action-ref fallback only did `actions.get(defaultActionRef)` — an 
exact key lookup. If the default ref name (e.g., `"movie-input"`) only matched 
a wildcard pattern (e.g., `"movie-*"`), the lookup returned `null` and the 
request failed with a 404.
   
   ## Fix
   
   After the exact lookup fails for the default action ref, also try the 
wildcard matcher:
   
   ```java
   config = actions.get(defaultActionRef);
   if (config == null) {
       config = 
namespaceActionConfigMatchers.get(namespace).match(defaultActionRef);
   }
   ```
   
   ## Test plan
   
   - [x] `ConfigurationTest#testDefaultActionRefWithWildcard` — 
default-action-ref resolves via wildcard matching
   - [x] `ConfigurationTest#testDefaultActionRefWithExactMatch` — 
default-action-ref resolves via exact match (pre-existing behavior)
   - [x] `ConfigurationTest#testDefaultActionRefWithWildcardNoMatch` — returns 
null when default-action-ref matches neither
   - [x] Full `ConfigurationTest` suite passes with no regressions
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to