[
https://issues.apache.org/jira/browse/WW-3717?focusedWorklogId=1047869&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1047869
]
ASF GitHub Bot logged work on WW-3717:
--------------------------------------
Author: ASF GitHub Bot
Created on: 16/Oct/26 14:45
Start Date: 16/Oct/26 14:45
Worklog Time Spent: 10m
Work Description: lukaszlenart opened a new pull request, #360:
URL: https://github.com/apache/struts-site/pull/360
Documents [WW-3717](https://issues.apache.org/jira/browse/WW-3717),
implemented in apache/struts#2038 (7.5.0).
Adds an "HTTP Methods" section to Action Configuration:
- the `http-method` attribute (7.5 DTD), single value or comma-separated list
- enforcement by the `httpMethod` interceptor, the stacks that include it,
and the startup warning when it is missing
- how it combines with the `@AllowedHttpMethod` / `@HttpGet` … annotations
- rejected requests: the resolvable `bad-request` result, otherwise 405 +
`Allow`
- a custom status code / message per package via a global `bad-request`
result of type `httpheader`
Merge together with the 7.5.0 release.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Issue Time Tracking
-------------------
Worklog Id: (was: 1047869)
Time Spent: 20m (was: 10m)
> Allow restricting an action to HTTP methods via an http-method attribute in
> struts.xml
> --------------------------------------------------------------------------------------
>
> Key: WW-3717
> URL: https://issues.apache.org/jira/browse/WW-3717
> Project: Struts 2
> Issue Type: New Feature
> Components: Dispatch Filter, XML Configuration
> Environment: All
> Reporter: Jeremy Norman
> Priority: Major
> Labels: restful
> Fix For: 7.5.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Allow an action declared in {{struts.xml}} to restrict which HTTP methods it
> accepts, using a new optional {{http-method}} attribute in the 7.5 DTD. This
> is the XML counterpart of the existing {{@HttpGet}} / {{@HttpPost}} /
> {{@AllowedHttpMethod}} annotations.
> {code:xml}<action name="action1" class="org.example.ListAction"
> http-method="get"> ...
> <action name="action2" class="org.example.SaveAction" http-method="post"> ...
> <action name="action3" class="org.example.FormAction" http-method="get,post">
> ...
> {code}
> A request using a method that is not listed is rejected by
> {{HttpMethodInterceptor}} with its configured bad-request result, the same
> way as for the annotations.
> Scope:
> * one action name maps to one action config; declaring the same action name
> twice with different methods is *not* supported here
> * enforced by {{HttpMethodInterceptor}}, which reads the action config in
> addition to the annotations; when both are present the request must satisfy
> both
> * the attribute is carried over to actions resolved from wildcard / regex
> patterns
> * an invalid method name fails configuration loading
> Routing the same action name to different action configs depending on the
> HTTP method is tracked in WW-5785 (8.0.0).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)