Reference: Spring Docs - @Qualifierarrow-up-right
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 @Autowired annotation, but there are a few things to be cautious about
@Autowired
If more than one bean of the same type exists in the container, Spring will throw a NoUniqueBeanDefinitionException
NoUniqueBeanDefinitionException
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
NoSuchBeanDefinitionException
Last updated 8 days ago