[ https://issues.apache.org/jira/browse/WW-5217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17596968#comment-17596968 ]
Alireza Fattahi commented on WW-5217: ------------------------------------- Thanks! In the the project the struts `2.5.30` was used and the `ognl-3.1.29.jar` was imported ( I have not add OGNL in pom and I think it was added as an struts dependency) . In version 3.1.29 the OgnlContext() has an empty constructor. I decompile and it is as below {code:java} public OgnlContext() { this(null, null, null); }{code} > new OgnlContext() is removed > ---------------------------- > > Key: WW-5217 > URL: https://issues.apache.org/jira/browse/WW-5217 > Project: Struts 2 > Issue Type: Bug > Components: Expression Language > Reporter: Alireza Fattahi > Priority: Major > > We used the OGNL in our classes as below > > {code:java} > OgnlExpression ognlExpression = new OgnlExpression(expressionString); > ognlExpression.getValue(new OgnlContext(), rootObject);{code} > > The OgnlExpression is a simple wrapper. > > > {code:java} > public class OgnlExpression{ > private Object expression; > private static final Logger LOG = > LoggerFactory.getLogger(OgnlExpression.class); > public OgnlExpression( String expressionString ) > throws OgnlException > { > super(); > expression = Ognl.parseExpression( expressionString ); > } > public Object getExpression() > { > return expression; > } > public Object getValue( OgnlContext context, Object rootObject ) > throws OgnlException > { > LOG.debug("parse the expression with OGNL"); > return Ognl.getValue( getExpression(), context, rootObject ); > } > public void setValue( OgnlContext context, Object rootObject, Object > value ) > throws OgnlException > { > Ognl.setValue(getExpression(), context, rootObject, value); > } > {code} > > After upgrade to version 6, the `new OgnlContext()` constructor seems to be > removed. I test the `new OgnlContext(null,null,null)` but got illegal > argument exception. > -- This message was sent by Atlassian Jira (v8.20.10#820010)