[ 
https://issues.apache.org/jira/browse/WW-5548?focusedWorklogId=969347&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-969347
 ]

ASF GitHub Bot logged work on WW-5548:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/May/25 12:26
            Start Date: 12/May/25 12:26
    Worklog Time Spent: 10m 
      Work Description: lukaszlenart commented on PR #1265:
URL: https://github.com/apache/struts/pull/1265#issuecomment-2872357344

   @MFAshby thanks a lot for review, you were right and these attributes should 
be controlled by the container.




Issue Time Tracking
-------------------

    Worklog Id:     (was: 969347)
    Time Spent: 1h 10m  (was: 1h)

> Request attribute jakarta.servlet.forward.servlet_path incorrectly set by 
> ServletDispatcherResult breaking sitemesh integration
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-5548
>                 URL: https://issues.apache.org/jira/browse/WW-5548
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 7.0.0
>            Reporter: Martin
>            Assignee: Lukasz Lenart
>            Priority: Major
>             Fix For: 7.1.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> The servlet request parameter jakarta.servlet.forward.servlet_path has the 
> following documentation in tomcat: 
> {noformat}
> The name of the request attribute that should be set by the container when 
> the forward(ServletRequest, ServletResponse) method is called. It provides 
> the original value of a path-related property of the request. See the chapter 
> "Forwarded Request Parameters" in the Servlet Specification for details.
> {noformat}
> Strut's org.apache.struts2.result.ServletDispatcherResult#doExecute method is 
> breaking this spec in a couple of ways: 
>  # it's setting the parameter to be the  path that the request is about to be 
> _forwarded_ to, not the _original_ path.
>  # it's setting the parameter itself, when that should be the responsibility 
> of the container (in this case, Tomcat) when  forward() is invoked.
> Documentation for jakarta.servlet.forward.servlet_path
> https://jakarta.ee/specifications/servlet/6.0/jakarta-servlet-spec-6.0#forwarded-request-parameters
> Tomcat container implementation of forward() which is responsible for setting 
> the parameter
> https://github.com/apache/tomcat/blob/99ebd1e375297ad02846322e85d533c61077a7dc/java/org/apache/catalina/core/ApplicationDispatcher.java#L241
> This is breaking integration with other tools which expect the 
> FORWARD_SERVLET_PATH to be set correctly, such as sitemesh (from version 3.1 
> onwards)
> {code:xml}
> <sitemesh>
>     ....
>     <mapping path="/auth/*.action" decorator="/WEB-INF/decorators/main.jsp"/>
>     ....
> </sitemesh>
> {code}
> Sitemesh now picks up the incorrectly set FORWARD_SERVLET_PATH which in my 
> case is mapped to a JSP in struts.xml like so 
> {code:xml}
> <struts>
> ...
>   <package name="authoritative links" extends="pkb-default" namespace="/auth" 
> strict-method-invocation="true">
>     <action name="dashboard" class="com.pkb.action.DashboardAction">
>       <result name="success">/WEB-INF/view/dashboard.jsp</result>
>     </action>
> ...
> {code}
> and my decorator is no longer applied, when it was previously.
> This behaviour was introduced in WW-5463



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to