摘要: spring除了提供了@Autowired,还提供了以下几类annotation。 1、@Component, @Repository, @Service, @Controller @Repository、@Service、@Controller在目前的 Spring 版本中,这 3 个注释和 @C 阅读全文
posted @ 2017-09-19 16:32 梦天幻 阅读(758) 评论(0) 推荐(0) 编辑
摘要: 一、@Autowired 1、@Autowired是spring自带的注解,通过‘AutowiredAnnotationBeanPostProcessor’ 类实现的依赖注入; 2、@Autowired是根据类型进行自动装配的,如果找到多个类型相同的,会按照名称进行匹配,如果名称相同,会报错,如果需 阅读全文
posted @ 2017-09-19 13:20 梦天幻 阅读(51387) 评论(0) 推荐(10) 编辑