Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
None
-
None
-
None
Description
We used the OGNL in our classes as below
OgnlExpression ognlExpression = new OgnlExpression(expressionString); ognlExpression.getValue(new OgnlContext(), rootObject);
The OgnlExpression is a simple wrapper.
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); }
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.