spring @autowired使用总结

1、首先需要在springmvc.xml和applicationContext.xml加入类扫描器配置。

1 <!-- 自动扫描注解 -->
2     <context:component-scan base-package="com.xytx.monitor" />

2、在需要使用的地方使用@autowired

坚持每天进步,自律改变自己
原文地址:https://www.cnblogs.com/seakyfly/p/12828196.html