我正在使用@ComponentScan并@Component定义我的春豆.我想要的是声明其中一个bean autowire-candidate=false.
@ComponentScan
@Component
autowire-candidate=false
这可以使用xml中的此属性来完成.是不是注释中的等价物?
我想要这个的原因是因为我有2个相同接口的实现,我不想使用@Qualifier.
@Qualifier
编辑:使用@Primary是一个有效的解决方案,但autowire候选人在我看来似乎是一个有用的功能与自己的语义.
谢谢
java spring spring-annotations
java ×1
spring ×1
spring-annotations ×1