lukaszlenart commented on a change in pull request #475:
URL: https://github.com/apache/struts/pull/475#discussion_r601289403



##########
File path: 
core/src/main/java/org/apache/struts2/components/template/FreemarkerTemplateEngine.java
##########
@@ -144,15 +144,23 @@ public void close() throws IOException {
             }
         };
 
+        LOG.debug("Puts action on the top of ValueStack, just before the tag");
+        if (action == null) {
+            LOG.debug("Action from ActionInvocation is null, assuming action 
is on the top of ValueStack");
+            action = stack.pop();
+        }
         try {
             stack.push(templateContext.getTag());
+            stack.push(action);
             template.process(model, writer);
         } finally {
-            stack.pop();
+            stack.pop(); // removes action
+            stack.pop(); // removes tag
+            stack.push(action); // puts back action

Review comment:
       Good catch, fixed!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to