Skip to content

WW-5706 Align RestfulActionMapper action name handling with DefaultActionMapper - #1880

Draft
lukaszlenart wants to merge 1 commit into
mainfrom
WW-5706-restful-action-name-validation
Draft

WW-5706 Align RestfulActionMapper action name handling with DefaultActionMapper#1880
lukaszlenart wants to merge 1 commit into
mainfrom
WW-5706-restful-action-name-validation

Conversation

@lukaszlenart

Copy link
Copy Markdown
Member

RestfulActionMapper derived the action name directly from the request URI, whereas DefaultActionMapper normalizes and validates it through cleanupActionName against the allowedActionNames pattern. This change applies the same validation in RestfulActionMapper (honouring the struts.allowed.action.names and struts.default.action.name settings) so both mappers handle action names consistently. When the extracted name does not match the allowed pattern, the configured default action name is used and a warning is logged.

Restful2ActionMapper already extends DefaultActionMapper and inherits this behaviour, so no change is needed there.

Added regression tests covering both a rejected and an accepted action name.

Fixes WW-5706

🤖 Generated with Claude Code

…h DefaultActionMapper

RestfulActionMapper derived the action name straight from the request
URI, unlike DefaultActionMapper which validates it via cleanupActionName
against the allowedActionNames pattern. Apply the same check (and the
struts.allowed.action.names / struts.default.action.name settings) so
both mappers handle action names consistently.

Fixes: https://issues.apache.org/jira/browse/WW-5706

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016XMyQ1CRuYZkqygmD4aGHv
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
69.2% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@lukaszlenart
lukaszlenart marked this pull request as draft August 30, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant