Reference: Spring Docs - @Qualifier
Used to explicitly specify which bean to select when injecting beans in the Spring Framework
- Autowire Need for Disambiguation
- Dependencies can be injected with the
@Autowiredannotation, but there are a few things to be cautious about - If more than one bean of the same type exists in the container, Spring will throw a
NoUniqueBeanDefinitionException
- Dependencies can be injected with the
The @Qualifier annotation can be used to specify the target to autowire
If a bean object with the qualifier value specified in @Qualifier does not exist, a NoSuchBeanDefinitionException is thrown