Closed
Description
zhangkaitao opened SPR-11269 and commented
cdi support like
@Produces
List<Conference> availableConfs;
see http://my.oschina.net/hantsy/blog/186939
because spring implement array/collection/map inject use find Component bean then add to array/collection/map。Can simple modify DefaultListableBeanFactory to support。please see 864 line:
https://github.com/zhangkaitao/spring4-showcase/blob/master/spring4-others/src/test/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
1、find like List<BeanInterface> bean;
2、find BeanInterface bean,add to List;
3、others;
only support java config way,if want support xml,need modify bean definition(add ResolvableType else collection class)
Affects: 4.0 GA
Issue Links:
- Allow for normal bean wiring semantics for types assignable to Map [SPR-7915] #12570 Allow for normal bean wiring semantics for types assignable to Map ("duplicates")
- @Autowired does not work for target bean of type Collection [SPR-12180] #16794
@Autowired
does not work for target bean of type Collection ("duplicates") - Cannot inject List<String> even using @Named [SPR-13585] #18162 Cannot inject List even using
@Named
("duplicates")