zoukankan      html  css  js  c++  java
  • Spring Annotation 详解

    1、<context:component-scan base-package="*.*" />

    该配置隐式注册了多个对注解进行解析的处理器,如:

    AutowiredAnnotationBeanPostProcessor      

    CommonAnnotationBeanPostProcessor

    PersistenceAnnotationBeanPostProcessor    

    RequiredAnnotationBeanPostProcessor

    其实,注解本身做不了任何事情,和XML一样,只起到配置的作用,主要在于背后强大的处理器

    其中就包括了<context:annotation-config/>配置项里面的注解所使用的处理器

    所以配置了<context:component-scan base-package="">之后,便无需再配置<context:annotation-config>

    2、<mvc:annotation-driven>

    就是支持mvc注解的,说白了就是使Controller中可以使用MVC的各种注解。

  • 相关阅读:
    02 树莓派的远程连接
    01 树莓派系统安装
    Python正课110 —— Django入门
    作业7 答案
    作业8
    作业7
    作业6
    文件操作
    字符编码
    基本数据类型之集合
  • 原文地址:https://www.cnblogs.com/yifanSJ/p/9226914.html
Copyright © 2011-2022 走看看