Revised SimpleEvaluationContext example

Issue: SPR-17581
This commit is contained in:
Juergen Hoeller
2018-12-12 13:04:51 +01:00
parent 7ff1b0e01d
commit b00f98fccf

View File

@@ -232,11 +232,10 @@ being placed in it. A simple example:
Simple simple = new Simple();
simple.booleanList.add(true);
SimpleEvaluationContext context = SimpleEvaluationContext().create();
// false is passed in here as a string. SpEL and the conversion service will
// correctly recognize that it needs to be a Boolean and convert it
EvaluationContext context = SimpleEvaluationContext.forReadOnlyDataBinding().build();
// "false" is passed in here as a String. SpEL and the conversion service
// will recognize that it needs to be a Boolean and convert it accordingly.
parser.parseExpression("booleanList[0]").setValue(context, simple, "false");
// b will be false