1、@AutoWired :可对成员函数,方法进行标注,完成自动装配工作;spring自动注入到这个类中;
<!-- autowired 配置--> <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
2、@Component :把普通pojo实例化到spring容器中,相当于配置文件中的<bean id="" class=""/>
spring 配置中就不用写bean=那些了;
<context:component-scan base-package="com.zhou"/>
3、@Resource :resource 作用在字段和方法上的时候,spring会从容器中寻找需要类型的bean,当作用于类时,spring会将当前类作为资源放入到容器中;