Tag Archives | spring annotation

Creating Custom @Qualifiers with Spring

To create a custom qualifier annotation, all you need to do is to define an annotation that’s itself annotated with @Qualifier. First create a new Java Project and configure it as Maven Project. For Reference, Click Here Add the following dependencies in pom.xml 1. Creating Custom Spring Qualifier Suppose we use @Qualifier(“car”) frequently and to [...]

Continue Reading ... Comments { 0 }

Spring @Qualifier Annotation

The @Qualifier annotation is accompanied with @Autowired to figure out which bean you want to wire. First create a new Java Project and configure it as Maven Project. For Reference, Click Here Add the following dependencies in pom.xml 1. POJO Now create Employee Class as following. Now create Address Class as following 2. Configuration Create [...]

Continue Reading ... Comments { 0 }

Spring @Required Annotation

The @Required annotation applies to bean property setter methods. This annotation simply indicates that the affected bean property must be populated at configuration time: either through an explicit property value in a bean definition or through autowiring. The container will throw an exception if the affected bean property has not been populated. First create a [...]

Continue Reading ... Comments { 0 }