Spring version: 2.5.6.A
I have a setter/getter that is a list of strings and I want to set the value element from a property placeholder.
Java:
Code:
public class MyClass
{
private List<String> myList;
public void setMyList(List<String> myList) {
this.myList = myList;
}
public List<String> getMyList() {
return myList;
}
}
Bean config:
Code:
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:my-properties.txt</value>
</property>
</bean>
<bean id="myClass" class="com.myCompany.MyClass">
<property name="myList">
<list>
<value>${my.property}</value>
</list>
</property>
</bean>
Property file:
The problem is that ${my.property} is not resolved as "foo".
The class receives the literal value "${my.property}".