zoukankan      html  css  js  c++  java
  • 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>  
  • 相关阅读:
    班级派团队项目小计(七)
    班级派团队项目小计(六)
    班级派团队项目小计(五)
    班级派团队项目小计(四)
    班级派团队项目小计(三)
    场景描述思密达~
    班级派团队项目小计(二)
    班级派团队项目小计(一)
    构建之法阅读笔记02
    JS获取坐标
  • 原文地址:https://www.cnblogs.com/tjudzj/p/9187447.html
Copyright © 2011-2022 走看看