博客
关于我
context:include-filter与exclude-filte控制扫描组件
阅读量:324 次
发布时间:2019-03-04

本文共 707 字,大约阅读时间需要 2 分钟。

context:include-filter与exclude-filte控制扫描组件

<!-- 扫描的时候排除一些不要的组件		type="annotation"按照注解进行排除,标了指定注解的组件不要			expression="":注解的全类名		type="assignable":指定排除某个具体的类,按照类排除				type="aspectj":aspectj表达式		type="custom":自动义TypeFilter,自己写代码确定哪些使用		type="regex":则正表达式	 -->	<context:component-scan base-package="com.atguigu">		<context:exclude-filter type="assignable" expression="com.atguigu.service.BookService"/>	</context:component-scan>		<!-- 只扫描进入哪些组件,默认都是全部扫描进来		use-default-filters="false:禁止默认规则,默认是全部扫描	 -->	 <context:component-scan base-package="com.atguigu" use-default-filters="false">	 	<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>	 </context:component-scan>

转载地址:http://tbze.baihongyu.com/

你可能感兴趣的文章
Mybatis快速入门
查看>>
Java类和对象
查看>>
Java集合Collection
查看>>
Java基础知识日积月累(Tip of the Day08)
查看>>
SpringMVC入门-概述和基本配置
查看>>
SpringBoot快速入门
查看>>
医疗管理系统-手机快速登录和SpringSecurity权限控制
查看>>
SpringCloud微服务简介
查看>>
网页实现微信登录
查看>>
vue源码分析(MVVM篇)
查看>>
vue源码分析(observe篇)
查看>>
ElasticSearch 快照备份和还原
查看>>
深入理解Kafka系列(五)--Kafka可靠的数据传递
查看>>
React(八)- ReactUI组件库及Redux的使用
查看>>
TypeScript系列(一)- TypeScript简介与编译配置
查看>>
TypeScript系列文章导航
查看>>
TypeScript系列(二)- Webpack打包TS代码
查看>>
Windows系统Git安装教程
查看>>
hibernate和mybatis的区别
查看>>
你为什么从大公司离职,去一家创业公司?
查看>>