You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2023/10/04 11:45:33 UTC

[struts] branch feature/WW-5338-remove-ognltool updated (b31637984 -> 2d7bff3ca)

This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch feature/WW-5338-remove-ognltool
in repository https://gitbox.apache.org/repos/asf/struts.git


 discard b31637984 WW-5338 Removes also deprecated constant in ContextUtil
     new 2d7bff3ca WW-5338 Removes also deprecated constant in ContextUtil

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (b31637984)
            \
             N -- N -- N   refs/heads/feature/WW-5338-remove-ognltool (2d7bff3ca)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/java/org/apache/struts2/views/velocity/VelocityManager.java  | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)


[struts] 01/01: WW-5338 Removes also deprecated constant in ContextUtil

Posted by lu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch feature/WW-5338-remove-ognltool
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 2d7bff3ca87fbaa342b818c608e0d236b8926980
Author: Lukasz Lenart <lu...@apache.org>
AuthorDate: Wed Oct 4 13:22:56 2023 +0200

    WW-5338 Removes also deprecated constant in ContextUtil
---
 core/src/main/java/org/apache/struts2/util/StrutsUtil.java            | 2 +-
 core/src/main/java/org/apache/struts2/views/util/ContextUtil.java     | 2 --
 .../main/java/org/apache/struts2/views/velocity/VelocityManager.java  | 4 +---
 3 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/core/src/main/java/org/apache/struts2/util/StrutsUtil.java b/core/src/main/java/org/apache/struts2/util/StrutsUtil.java
index 13c574fbd..c693599e7 100644
--- a/core/src/main/java/org/apache/struts2/util/StrutsUtil.java
+++ b/core/src/main/java/org/apache/struts2/util/StrutsUtil.java
@@ -119,8 +119,8 @@ public class StrutsUtil {
     }
 
     public Object findValue(String expr, Object context) {
+        stack.push(context);
         try {
-            stack.push(context);
             return stack.findValue(expr, true);
         } finally {
             stack.pop();
diff --git a/core/src/main/java/org/apache/struts2/views/util/ContextUtil.java b/core/src/main/java/org/apache/struts2/views/util/ContextUtil.java
index 97c148f37..4ab3c2786 100644
--- a/core/src/main/java/org/apache/struts2/views/util/ContextUtil.java
+++ b/core/src/main/java/org/apache/struts2/views/util/ContextUtil.java
@@ -36,7 +36,6 @@ public class ContextUtil {
     public static final String SESSION = "session";
     public static final String BASE = "base";
     public static final String STACK = "stack";
-    public static final String OGNL = "ognl";
     public static final String STRUTS = "struts";
     public static final String ACTION = "action";
 
@@ -49,7 +48,6 @@ public class ContextUtil {
         map.put(STACK, stack);
         StrutsUtil util = new StrutsUtil(stack, req, res);
         map.put(STRUTS, util);
-        map.put(OGNL, util); // Deprecated since 6.3.0
 
         ActionInvocation invocation = stack.getActionContext().getActionInvocation();
         if (invocation != null) {
diff --git a/plugins/velocity/src/main/java/org/apache/struts2/views/velocity/VelocityManager.java b/plugins/velocity/src/main/java/org/apache/struts2/views/velocity/VelocityManager.java
index 7acb9bdc1..5cff252e3 100644
--- a/plugins/velocity/src/main/java/org/apache/struts2/views/velocity/VelocityManager.java
+++ b/plugins/velocity/src/main/java/org/apache/struts2/views/velocity/VelocityManager.java
@@ -56,8 +56,7 @@ import java.util.Properties;
 import static java.lang.String.format;
 import static java.util.Collections.emptyList;
 import static java.util.stream.Collectors.joining;
-import static java.util.stream.Collectors.toList;
-import static org.apache.struts2.views.util.ContextUtil.OGNL;
+import static java.util.stream.Collectors.toList;;
 import static org.apache.struts2.views.util.ContextUtil.STRUTS;
 
 /**
@@ -133,7 +132,6 @@ public class VelocityManager {
         ContextUtil.getStandardContext(stack, req, res).forEach(context::put);
         VelocityStrutsUtil util = new VelocityStrutsUtil(velocityEngine, context, stack, req, res);
         context.put(STRUTS, util);
-        context.put(OGNL, util); // Deprecated since 6.3.0
         return context;
     }