I have a simple class something like:
public class ValueProvider {
public void setExpression(String expression) {
this.expression = expression;
}
public String getValue() {
Expression exp = new SpelExpressionParser().parseExpression(this.expression);
return exp.getValue(new StandardEvaluationContext(new Foo()), String.class);
}
private String expression;
}
Unfortunately, when I try to register the provider it tries to evaluate the provided expression:
<bean class="com.ValueProvider">
<property name="expression" value="#{bar}" />
</bean>
Any ideas for how to get Spring to treat the value attribute as a string/expression literal?
according to the state of SPR-704 this is not possible.