<context:component-scan base-package="com.matt.cloud"/>

bean-context中

spring.handlers文件

http\://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler

public class ContextNamespaceHandler extends NamespaceHandlerSupport {

    public void init() {
registerBeanDefinitionParser("property-placeholder", new PropertyPlaceholderBeanDefinitionParser());
registerBeanDefinitionParser("property-override", new PropertyOverrideBeanDefinitionParser());
registerBeanDefinitionParser("annotation-config", new AnnotationConfigBeanDefinitionParser());
registerBeanDefinitionParser("component-scan", new ComponentScanBeanDefinitionParser());
registerBeanDefinitionParser("load-time-weaver", new LoadTimeWeaverBeanDefinitionParser());
registerBeanDefinitionParser("spring-configured", new SpringConfiguredBeanDefinitionParser());
registerBeanDefinitionParser("mbean-export", new MBeanExportBeanDefinitionParser());
registerBeanDefinitionParser("mbean-server", new MBeanServerBeanDefinitionParser());
} }

NamespaceHandlerSupport类

ComponentScanBeanDefinitionParser类扫描注解

根据配置的路径加载class文件,当配置问空时可以从jar文件中加载class文件

加载Class文件的方式是,解析Class文件,但没有 "类加载" classLoad发生

加载为 ScannedGenericBeanDefinition类

context:component-scan 注解的扫描的更多相关文章

  1. @Component 元注解

    @Component 元注解 这是一个元注解,意思是它可以用于标注其他注解,被它标注的注解和它起到相同或者类似的作用.Spring用它定义了其他具有特定意义的注解如@Controller @Servi ...

  2. [Spring Boot] Use Component Scan to scan for Bean

    Component Scan is important concept when we want to create Bean. Currently we know what, for the cla ...

  3. Spring异常累计(1)Spring注解与扫描,NoUniqueBeanDefinitionException

    spring中可以使用注解机制,代替传统的在xml中配置一个bean. 如 <pre name="code" class="java">@Compo ...

  4. @component的注解

    1.@controller 控制器(注入服务) 2.@service 服务(注入dao) 3.@repository dao(实现dao访问) 4.@component (把普通pojo实例化到spr ...

  5. 使用jersey 注解包扫描类PackageNamesScanner

    Jersey 中自带一个包扫描,可以是包,或者具体类名 ,扫描的类型是自己定注解类型,实现功能更加大,可以是jar 包 可以是虚拟地址下的 Jersey 主要用来扫描Path Provider 类中同 ...

  6. Spring框架中的org.springframework.context.annotation.Import注解类

    @Import注解的作用和在使用spring的xml配置时用到的<import/>类似.但应注意是@Import在使用时必须要保证能被IOC容器扫描到,所以通常它会和@Configurat ...

  7. 外部jar包 @Service 无法注解无法扫描问题

    在确保spring 配置 无误的情况下,如: <context:component-scan base-package="your.can.pakeage"></ ...

  8. SpringMVC_01:创建运行环境(Maven)

    Maven 环境下配置: 1.新建MavenProject,打包选线根据情况选择jar war和pom jar:打包为jar包,主要用于被其他项目引用 war:打包为war包,可直接运行于服务器 po ...

  9. MyBatis从入门到精通(第9章):Spring集成MyBatis(上)

    MyBatis从入门到精通(第9章):Spring集成MyBatis(上) Spring是一个为了解决企业级Web应用开发过程中面临的复杂性,而被创建的一个非常流行的轻量级框架. mybatis-sp ...

随机推荐

  1. USACO 1.1 Greedy Gift Givers

    模拟. 如果用$map$的话,会很好写. 如果你不会$map$的话,在此小广告:https://blog.csdn.net/CQBZLYTina/article/details/80063739 /* ...

  2. springboot整合es客户端操作elasticsearch(四)

    对文档查询,在实际开发中,对文档的查询也是偏多的,记得之前在mou快递公司,做了一套事实的揽件数据操作,就是通过这个来存储数据的,由于一天的数据最少拥有3500万数据 所以是比较多的,而且还要求查询速 ...

  3. 第二次Java实验报告

    Java实验报告 班级 计科二班 学号 20188437 姓名 何磊 完成时间 2019/9/12 评分等级 实验二 Java简单类与对象 实验目的 掌握类的定义,熟悉属性.构造函数.方法的作用,掌握 ...

  4. mysql --explain+slowlog

    一.EXPALIN 在SQL语句之前加上EXPLAIN关键字就可以获取这条SQL语句执行的计划 那么返回的这些字段是什么呢? 我们先关心一下比较重要的几个字段: 1. select_type 查询类型 ...

  5. 查询list转化为tree的两种方式及排序

    方式一,数据库查询tree; MyBatis collection 集合 MyBatis 是数据持久层框架,支持定制化 SQL.存储过程以及高级映射.尤其强大在于它的映射语句,比如高级映射中的 col ...

  6. linux网络route

    一.网络基础知识: 设备端获取的IP路由表 [root@HKVS /] # route –n Kernel IP routing table Destination     Gateway       ...

  7. xtrabackup备份失败(error writing file 'UNOPENED')

    xtrabackup备份失败 解决了,是因为limit open files值设置太小了 (3)修改资源限制参数 vi /etc/security/limits.conf nproc:用户创建进程数限 ...

  8. shell中防止意外发生的两个实用的设置

    set -o nounset set -o errexit set -o nounset 在默认情况下,遇到不存在的变量,会忽略并继续执行,而这往往不符合预期,加入该选项,可以避免恶果扩大,终止脚本的 ...

  9. quartus ii 粗略使用教程

    重复刚刚做过的下载程序,不选sof文件,选择jic文件 选择program config然后点击start,观察开发板,断电在开启后仍然有效果,想要擦除开发板flash文件,可以点击取消program ...

  10. L1-064 估值一亿的AI核心代码 (20 分)

    L1-064 估值一亿的AI核心代码 (20 分)   以上图片来自新浪微博. 本题要求你实现一个稍微更值钱一点的 AI 英文问答程序,规则是: 无论用户说什么,首先把对方说的话在一行中原样打印出来: ...