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面向对象》实验报告
一.程序设计中临时变量的使用 import java.util.Arrays; public class Array { public static void main(String[] args) ...
- GNOME桌面的安装
首先搭建yum仓库 http://www.cnblogs.com/jw35/p/5967677.html yum grouplist #列出yum仓库里的软件组 ...
- 深水划水队项目---七天冲刺之day5
站立式会议: 因为今天有成员回家,不能进行线下站立式会议,只能线上进行语音聊天 工作进度: 昨天完成的任务: 游戏功能的基本实现 商讨出如何实现游戏中的难度选择功能与道具功能 商讨出站立式会议能线下 ...
- MS EXCEL2013添加Oracle Web ADI菜单
- Python学习-8.Python的循环语句-while语句
例子: i = 1 while i < 10: print(i) i+=1 else: print('finish') 输出1至9和finish 在while语句中同样支持for语句所支持的co ...
- EJB学习手记
周末两天,看了两天的ejb知识.公司有个转发消息的程序,里面是根据ejb/jms+cdi/event做的,这些之前没接触过. 总而言之,从中学到了很多东西,从ejb到webservice. jboss ...
- Tempdb--Row version
Trigger:在SQL SERVER 2005之前,触发器需要使用日志来获取DELETED AND INSERTED的数据,因此会打乱日志顺序写的模式,造成磁盘压力,在SQL Server2005 ...
- expect+scp传输文件发现文件丢失
背景 使用expect+scp去跨机器传输文件,(别问我为什么,因为公司的测试机器都是通过堡垒机的,无法绕开堡垒机,只能暂时使用这个方法了),结果发现从A传递到B的tar.gz文件大小不一致了的,当时 ...
- php函数源代码 C编写 【持续更新】
由于经常被抓取文章内容,在此附上博客文章网址:,偶尔会更新某些出错的数据或文字,建议到我博客地址 : --> 点击这里 strlen() 获取字符串长度,成功则返回字符串 string 的长度 ...
- 【OCP-12c】CUUG 071题库考试原题及答案解析(21)
3.choose three View the Exhibit and examine the description of SALES and PROMOTIONS tables. You want ...