Spring / Spring interview questions
How do I enable annotation based auto wiring in Spring Framework?
To enable annotation based wiring, @Autowired, org.springframework.beans .factory.annotation. AutowiredAnnotation BeanPostProcessor need to be registered and it could be achieved in 2 ways.
- Include
<context:annotation-config>in bean configuration file.<beans> ... <context:annotation-config /> ... </beans>
- Include AutowiredAnnotation BeanPostProcessor directly in bean configuration file.
<beans> <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/> </beans>
More Related questions...