Hi everyone,
I'm trying to combine Spel with property place holder. What I'm trying to achieve is something like this:
<bean name="myBean" class="test.MyBean>
<property name="myBooleanProp" value="${#{T(test.MyEnum).MY_ENUM_INSTANCE.key}}"/>
</bean>
So, I would like to pass as property key the value of my enum instance resolved with Spel.
The example above doesn't work. It throws this exception:
org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'boolean' for property 'myBooleanProp'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value [${myEnumInstanceKey}].
The property place holder isn't resolved.
Is there a way to achieve this combination?
Thanks in advance,
Andrea Tevoi


Reply With Quote
