In spring, I want to inject values in list property dynamically. Is it possible?
For e.g. Instead of specifying value 1 three times, does there exist some property which can repeat this values multiple times based on some value.
<bean id='myBean' class-"com.foo.Xyz">
<property name="myList">
<value>1</value>
<value>1</value>
<value>1</value>
</property>
</bean>
Please let me know if question is not clear.
What about custom
FactoryBean?You can use it in the following way (however I haven’t tested it):
Note that both count and an object that is to be repeated are declaratively configurable.