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

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

                Author: ASF GitHub Bot
            Created on: 02/Jan/24 10:12
            Start Date: 02/Jan/24 10:12
    Worklog Time Spent: 10m 
      Work Description: kusalk commented on code in PR #822:
URL: https://github.com/apache/struts/pull/822#discussion_r1439307636


##########
plugins/velocity/src/main/java/org/apache/struts2/views/velocity/StrutsVelocityContext.java:
##########
@@ -96,11 +96,15 @@ protected Object chainedContextGet(String key) {
             return null;
         }
         for (VelocityContext chainedContext : chainedContexts) {
-            Object val = chainedContext.internalGet(key);
+            Object val = chainedContext.get(key);
             if (val != null) {
                 return val;
             }
         }
         return null;
     }
+
+    public ValueStack getValueStack() {
+        return stack;
+    }

Review Comment:
   I think it has to be but I wonder if Directives can simply obtain the 
ValueStack from the ActionContext? It's not clear to me if the ValueStack on 
the ActionContext changes between the time of Velocity context creation and 
directive rendering. I recall this was how the ValueStack was obtained in 
WebWork 2.1 but I presume it was changed for a reason?
   
   But also, there's no change in terms of security as the stack was already 
exposed on the `StrutsVelocityContext` instance using `internalGet("stack")` or 
`get("stack")`.
   
   And yep I can definitely use a marker interface to allow more flexibility in 
the Velocity context implementation used by applications.





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

    Worklog Id:     (was: 897635)
    Time Spent: 1.5h  (was: 1h 20m)

> Implement alternative mechanism for Velocity directives to obtain stack
> -----------------------------------------------------------------------
>
>                 Key: WW-5379
>                 URL: https://issues.apache.org/jira/browse/WW-5379
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - Velocity
>            Reporter: Kusal Kithul-Godage
>            Priority: Minor
>             Fix For: 6.4.0
>
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>




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

Reply via email to