草庐IT

SomeBeanClass

全部标签

java - 如果 Spring 中没有 bean,是否有一种简单的方法来 Autowiring 空集合?

如果我有@AutowiredListbeans;没有SomeBeanClass的bean,我得到:Nomatchingbeanoftype[SomeBeanClass]foundfordependency[collectionofSomeBeanClass]:expectedatleast1beanwhichqualifiesasautowirecandidateforthisdependency.Dependencyannotations:{@org.springframework.beans.factory.annotation.Autowired(required=true)}如

java - 如果 Spring 中没有 bean,是否有一种简单的方法来 Autowiring 空集合?

如果我有@AutowiredListbeans;没有SomeBeanClass的bean,我得到:Nomatchingbeanoftype[SomeBeanClass]foundfordependency[collectionofSomeBeanClass]:expectedatleast1beanwhichqualifiesasautowirecandidateforthisdependency.Dependencyannotations:{@org.springframework.beans.factory.annotation.Autowired(required=true)}如