spring中排除某个类
在spring中可能需要排除某个类,做法是在spring配置文件中加入如下配置
<context:component-scan base-package="com.ias" use-default-filters="false">
<context:exclude-filter type="assignable" expression="com.ias.agdis.terminal.rest.impl.endpoint.SecurityEndpointImpl"/>
</context:component-scan>
配置效果如下图所示:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring-2.16.1.xsd"> <context:component-scan base-package="com.ias" use-default-filters="false">
<context:exclude-filter type="assignable" expression="com.ias.agdis.terminal.rest.impl.endpoint.SecurityEndpointImpl"/>
</context:component-scan> <!-- 将配置文件读取到容器中,交给Spring管理 -->
<bean id="configProperties"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="locations">
<list>
<value>classpath:jdbc_mysql.properties</value>
<value>classpath:config.properties</value>
</list>
</property>
<!-- 设置编码格式 -->
<property name="fileEncoding" value="UTF-8"></property>
</bean>
<!-- 将多个配置文件位置放到列表中 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer">
<property name="properties" ref="configProperties" />
</bean>
spring中排除某个类的更多相关文章
- 简单了解Spring中常用工具类_java - JAVA
文章来源:嗨学网 敏而好学论坛www.piaodoo.com 欢迎大家相互学习 文件资源操作 Spring 定义了一个 org.springframework.core.io.Resource 接口, ...
- spring中常用工具类介绍
http://www.cnblogs.com/langtianya/p/3875103.html 文件资源操作 Spring 定义了一个 org.springframework.core.io ...
- java普通类如何得到spring中的bean类
在SSH集成的前提下.某些情况我们需要在Action以外的类中来获得Spring所管理的Service对象. 之前我在网上找了好几好久都没有找到合适的方法.例如: ApplicationContext ...
- java反射的补充:桥接方法以及Spring中一些工具类
在上一篇博文中:http://www.cnblogs.com/guangshan/p/4660564.html 源码中有些地方用到了 this.bridgedMethod = BridgeMethod ...
- Spring中为什么实体类不用注入
要理解为什么不用注入,首先就清楚注入的目的是什么?如果不注入,在程序中要使用某个类对象的方法,则需要去new一个对象.然后我们调用其中的方法,众所周知"程序=算法+数据".不失一般 ...
- JavaEE开发之Spring中的条件注解组合注解与元注解
上篇博客我们详细的聊了<JavaEE开发之Spring中的多线程编程以及任务定时器详解>,本篇博客我们就来聊聊条件注解@Conditional以及组合条件.条件注解说简单点就是根据特定的条 ...
- JavaEE开发之Spring中的条件注解、组合注解与元注解
上篇博客我们详细的聊了<JavaEE开发之Spring中的多线程编程以及任务定时器详解>,本篇博客我们就来聊聊条件注解@Conditional以及组合条件.条件注解说简单点就是根据特定的条 ...
- spring中afterPropertiesSet方法与init-method配置描述
1. InitializingBean.afterPropertiesSet()Spring中InitializingBean接口类为bean提供了定义初始化方法的方式,它仅仅包含一个方法:after ...
- 用通俗的语言解释 Spring 中的 DI 、IOC 和AOP概念
DI 所谓依赖,从程序的角度看,就是比如A要调用B的方法,那么A就依赖于B,反正A要用到B,则A依赖于B.所谓倒置,你必须理解如果不倒置,会怎么着,因为A必须要有B,才可以调用B,如果不倒置,意思就是 ...
随机推荐
- JAVA AQS源码分析
转自: http://www.cnblogs.com/pfan8/p/5010526.html JAVA AQS的全称为(AbstractQueuedSynchronizer),用于JAVA多线程的 ...
- handsontable-developer guide-setting options,callback
1.cell数组 cell: [ {row: 0, col: 0, readOnly: true} ] 2.cells函数 cells: function(row, col, prop){ var c ...
- 词频统计-part2
看到这个问题为之一愣,这简单多了,在第一部分的基础上把那些存储结构删了,把排序算法删了,设置一个变量,遇到则加一,直到读到文件尾.最后输出单词出现次数. 程序比较简单也比较,下面就把程序贴出来: pa ...
- LINQ to Entities 基于方法的查询语法
1.投影: Select 与 SelectMany SelectMany操作符提供了将多个from子句组合起来的功能,相当于数据库中的多表连接查询,它将每个对象的结果合并成单个序列. 与 select ...
- EF按时间范围条件查询
查询今日数据 db.Table.Where(d => System.Data.Entity.DbFunctions.DiffDays(d.Time, DateTime.Now) == )
- 遍历datatable的几种方法(C# )
转载 遍历datatable的方法2009-09-08 10:02方法一: DataTable dt = dataSet.Tables[0]; for(int i = 0 ; i ...
- IIS服务器添加网站
1.添加IIS服务:对“我的电脑”右键,管理,点击服务和应用程序,如果下面没有”Internet Information Services(IIS)管理器“,打开控制面板,点击程序,启用或者关闭Win ...
- trace sql log
C:\Windows\system32>cd /d d:\PSSDIAG\pssd_2k12_x64 d:\PSSDIAG\pssd_2k12_x64>pssdiag.cmd 2014/ ...
- python---基本数据类型 dict(字典)
1. 什么是字典 字典是python中唯一的映射类型, 由{ } 括起来的键值对组成,在dict中key是唯一的.字典是以key:value的形式来保存数据, 字典存储数据的时候是用的hash值来存储 ...
- 【OCP-12c】CUUG 071题库考试原题及答案解析(16)
16.(7-5) choose the best answerThe PRODUCTS table has the following structure:Evaluate the following ...