Revised SimpleEvaluationContext example
Issue: SPR-17581
This commit is contained in:
@@ -231,10 +231,10 @@ being placed in it. A simple example:
|
|||||||
Simple simple = new Simple();
|
Simple simple = new Simple();
|
||||||
simple.booleanList.add(true);
|
simple.booleanList.add(true);
|
||||||
|
|
||||||
EvaluationContext context = SimpleEvaluationContext().forReadOnlyDataBinding().build();
|
EvaluationContext context = SimpleEvaluationContext.forReadOnlyDataBinding().build();
|
||||||
|
|
||||||
// false is passed in here as a string. SpEL and the conversion service will
|
// "false" is passed in here as a String. SpEL and the conversion service
|
||||||
// correctly recognize that it needs to be a Boolean and convert it
|
// will recognize that it needs to be a Boolean and convert it accordingly.
|
||||||
parser.parseExpression("booleanList[0]").setValue(context, simple, "false");
|
parser.parseExpression("booleanList[0]").setValue(context, simple, "false");
|
||||||
|
|
||||||
// b will be false
|
// b will be false
|
||||||
|
|||||||
Reference in New Issue
Block a user