、、的用法

      在Spring中表示在自动装配时,我们可以使用注解的方式 例如:@Autowired,但是此时在xml文件中仍需要bean配置,只不过此时代替了bean的property

        表示扫描指定的包,将注解的类注册为spring容器中的bean,那么此时我们在xml文件中就不需要定义bean,实现xml文件的零配置

     表示在SpringMVC中注册了DefaultAnnotationHandlerMapping与AnnotationMethodHandlerAdapter 两个bean,表示为@controller、@requestMapping做好准备工作,但是 此时被注解的bean并没有被加入到spring容器中,此时需要用扫描并注册bean,因此我们在SpringMVC中出现将一起使用。


你可能感兴趣的:(Spring)