I’d like to do something like
<bean id="xxx" class="yyy">
<property name="list">
<list>
<ref bean="bean1" />
<ref bean="bean2" />
</list>
</property>
</bean>
The beans “bean1” and “bean2” are two different implementations of an interface I. However, they belong to different classes. Does anyone know how I can do this? I have no problem constructing a list of Strings and a list of Integers. Why can’t I construct a list of beans?
Thanks,
ktm
It should work. Try it.
(There should be no runtime type problem here because the runtime type of the list is the raw type of the implementation class used.)
I think you are assuming that it won’t work without trying it.