Spring | Autowiring Qualifier

Spring provides @Qualifier annotation to refer correct bean while doing autowiring.

Suppose we have interface IService which has two concrete implementation.

When we try to Autowire IService object in any other class it will throw exception as there are two beans.

Spring Qualifier is used in such situation to place object of correct implementation class to autowired object.
 
Now, above iservice object will hold object of IServiceImplTwo class.

Comments

Post a Comment

Popular posts from this blog

Spring | Using TIBCO EMS with Spring framework

TIBCO | For Loop - Accumulate output

TIBCO | JNDI Server & JMS Instance creation