I know that in Spring you can load all beans of a specific type with:
ClassPathResource res = new ClassPathResource("spring_foo.xml"); XmlBeanFactory factory = new XmlBeanFactory(res); Map<String, Foo> beans = factory.getBeansOfType(Foo.class);
How can I do this in XML? For instance. sort of:
<bean id="fooHandler" class="com.mycompany.FooHandler"> <property name="foos"> <map beanType="com.mycompany.Foo" / > </property> </bean>
Or is it better with a list rather than a map?
source share