[
https://issues.apache.org/jira/browse/WW-5842?focusedWorklogId=1053214&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1053214
]
ASF GitHub Bot logged work on WW-5842:
--------------------------------------
Author: ASF GitHub Bot
Created on: 07/Nov/26 10:54
Start Date: 07/Nov/26 10:54
Worklog Time Spent: 10m
Work Description: lukaszlenart opened a new pull request, #370:
URL: https://github.com/apache/struts-site/pull/370
Companion to [WW-5842](https://issues.apache.org/jira/browse/WW-5842): the
REST mapper no longer recognises `/movies/Thrillers;edit`. The documented
`/movies/Thrillers/edit` form selects the method by name, so the page drops the
`;edit` example and describes what `struts.mapper.editMethodName` still
controls (the result rendered when a PUT request fails validation).
Merge with the 7.5.0 / 6.13.0 release.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Issue Time Tracking
-------------------
Worklog Id: (was: 1053214)
Time Spent: 0.5h (was: 20m)
> Action mapping should rely on the servlet path and path info reported by the
> container
> --------------------------------------------------------------------------------------
>
> Key: WW-5842
> URL: https://issues.apache.org/jira/browse/WW-5842
> Project: Struts 2
> Issue Type: Bug
> Components: Core
> Reporter: Lukasz Lenart
> Assignee: Lukasz Lenart
> Priority: Major
> Fix For: 6.13.0, 7.5.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> RequestUtils.getServletPath derives the path to map from
> HttpServletRequest.getRequestURI() in two cases: when the request URI does
> not end with the servlet path reported by the container (WW-2268, to keep a
> {{;jsessionid=...}} suffix), and when the container reports an empty servlet
> path, as it does for a servlet mapped to {{/*}}. In both cases the value
> comes from the raw request URI, so it differs from the servlet path and path
> info the container has already decoded: it still carries percent-encoding and
> path parameters. {{DefaultActionMapper}} then drops everything after the
> first {{;}}, and {{RestActionMapper}} keeps a trailing {{;edit}} to select
> the edit method (WW-4585 added the same handling to the {{!method}} form).
> Every consumer of the helper afterwards works with the container's view of
> the request (action name and namespace, the exclusion patterns, the static
> resource lookup, {{<s:include>}} and {{ResourceUtil}}), so the reconstruction
> is a second interpretation of the same request that can differ from the
> container's.
> h2. Proposed change
> * {{RequestUtils.getServletPath}} returns the servlet path followed by the
> path info, both as reported by the container; the request URI is no longer
> consulted. {{getUri}} keeps its include-attribute handling.
> * {{DefaultActionMapper}} and {{RestActionMapper}} no longer treat {{;}} in
> the mapped path specially. On a Servlet 3+ container path parameters never
> reach the servlet path or the path info, so {{;jsessionid=...}} needs no
> handling in Struts.
> * The REST plugin's {{;edit}} form ({{GET /movies/Thrillers;edit}}) is
> removed. {{GET /movies/Thrillers/edit}} is the documented equivalent and
> continues to work; the plugin documentation drops the {{;edit}} example.
> {{RestActionMapper.setEditMethodName}} becomes a deprecated no-op (removal:
> WW-5843); {{RestWorkflowInterceptor}} keeps reading
> {{struts.mapper.editMethodName}}.
> * {{ExecuteOperations}} no longer needs its own path-info fallback for an
> empty servlet path.
> * The JUnit plugin's {{executeAction}}, {{getActionProxy}} and
> {{getActionMapping}} helpers set the servlet path on the mock request as well
> as the request URI.
> h2. Compatibility
> * Applications linking to the REST {{;edit}} form have to switch to {{/edit}}.
> * With a servlet mapped to {{/*}} in front of Struts, the action path is now
> taken from the decoded path info rather than from the raw request URI.
> * Tests that drive Struts with a mock request (for example Spring's
> {{MockHttpServletRequest}}) must set the servlet path, not only the request
> URI, as a container would; the JUnit plugin helpers do this already.
> Same change on the 6.x line.
> Reported by Svyatoslav Berestovsky.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)