yasserzamani commented on a change in pull request #475:
URL: https://github.com/apache/struts/pull/475#discussion_r601267884
##########
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:
I meant this part. This lines only makes sense when `action` had been
null previously. Otherwise I think it'll end up with a ValueStack which has
duplicate actions in stack from a same instance.
--
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]