compont专题

annotation-config, annotation-driven, compont-scan 区别

综合网上答案 <context:annotation-config/> 隐式地向Spring容器中注册AutowiredAnnotationBeanPostProcessor、CommonAnnotationBeanPostProcessor、PersistenceAnnotationBeanPostProcessor 及 equiredAnnotationBeanPostProces

spring的@compont和@service以及@controller,@repository区别

1、@controller 控制器(注入服务) 2、@service 服务(注入dao) 3、@repository dao(实现dao访问) 4、@component (把普通pojo实例化到spring容器中,相当于配置文件中的<bean id="" class=""/>)   @Component,@Service,@Controller,@Repository注解的类,