@Autowired

在applicationContext.xml中加入:

<!-- 该 BeanPostProcessor 将自动对标注 @Autowired 的 Bean 进行注入 -->     
<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>  

@Autowired 自动装配get..set..

原文地址:https://www.cnblogs.com/baobao2010/p/3182141.html