[
https://issues.apache.org/jira/browse/WW-3717?focusedWorklogId=1047998&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1047998
]
ASF GitHub Bot logged work on WW-3717:
--------------------------------------
Author: ASF GitHub Bot
Created on: 17/Oct/26 07:23
Start Date: 17/Oct/26 07:23
Worklog Time Spent: 10m
Work Description: lukaszlenart merged PR #2038:
URL: https://github.com/apache/struts/pull/2038
Issue Time Tracking
-------------------
Worklog Id: (was: 1047998)
Time Spent: 1h (was: 50m)
> 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: 1h
> 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)