spring中注解注入 context:component-scan 的使用说明_<context:component-scan-CSDN博客

网站介绍:文章浏览阅读7.5w次,点赞36次,收藏106次。spring中注解注入<context:component-scan>的使用说明@Service告诉spring容器,这是一个Service类,默认情况会自动加载它到spring容器中。 @Autowried注解告诉spring,这个字段需要自动注入 @Scope指定此spring bean的scope是单例 @Repository注解指定此类是一个容器类,是DA层类的实现。context.c_