WW-5338 Removes also deprecated constant in ContextUtil

This commit is contained in:
Lukasz Lenart
2023-10-04 13:22:56 +02:00
parent debcb541e3
commit 3b41e6bcb7
4 changed files with 1 additions and 6 deletions
@@ -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();
@@ -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) {
@@ -57,7 +57,6 @@ 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 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;
}
@@ -94,7 +94,6 @@ public class VelocityManagerTest extends StrutsJUnit4TestCase {
assertNotNull(context);
assertThat(context.get("struts")).isInstanceOf(VelocityStrutsUtil.class);
assertThat(context.get("ognl")).isInstanceOf(VelocityStrutsUtil.class); // Deprecated since 6.3.0
assertThat(context.get("stack")).isInstanceOf(ValueStack.class);
assertThat(context.get("request")).isInstanceOf(HttpServletRequest.class);
assertThat(context.get("response")).isInstanceOf(HttpServletResponse.class);