Spring

Annotation Based Configuration

Annotation Based Configuration

It became conceivable to design the Dependency  infusion utilizing annotations. So rather than utilizing XML to depict a bean wiring, you can move the bean setup into the part class itself by utilizing comments on the pertinent class, strategy, or field statement. Explanation infusion is performed before XML infusion. Hence, the final design will supersede the previous for properties wired through the two methodologies. 

Explanation wiring isn't turned on in the Spring compartment naturally. Along these lines, before we can utilize explanation-based wiring, we should empower it in our Spring arrangement document. So, consider the accompanying design record in the event that you need to utilize any comment in your Spring application.

<beans xmlns = "http://www.springframework.org/schema/beans"
   xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
   xmlns:context = "http://www.springframework.org/schema/context"
   xsi:schemaLocation = "http://www.springframework.org/schema/beans
   http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
   http://www.springframework.org/schema/context
   http://www.springframework.org/schema/context/spring-context-3.0.xsd">

   <context:annotation-config/>
   <!-- bean definitions go here -->

</beans>