I've already found the result.
<constructor-arg> <list> <value>${folder1.path}</value> <value>${folder2.path}</value> </list> </constructor-arg>
Frage
Could you help me what the proper way of writing spring bean with parameter of list values which I get from .properties file.
<bean id="property" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:dateFormat.properties" />
</bean>
<bean id="directoryMarshallerFolder1" class="threadService.DirectoryMarshalerFolder1">
<constructor-arg>
<list>
...
<value = "${folder1.path}"/> ?????
<value = "${folder2.path}"/>
...
</list>
</constructor-arg>
</bean>
Lösung 2
I've already found the result.
<constructor-arg> <list> <value>${folder1.path}</value> <value>${folder2.path}</value> </list> </constructor-arg>
Andere Tipps
You need to tell spring to load your property file :
<bean name="propertyPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>classpath:application.properties</value>
</property>
</bean>
Please note that your file application.properties must be in the classpath of your project (src/main/resources
is a good pick if you use the maven way)
Then you can use the constructor-arg tag to populate your bean :
<constructor-arg index="0" value="${property.key1}"/>
<constructor-arg index="1" ref="${property.key2}" />