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>  
  • 相关阅读:
    怎么控制 echarts提示框浮层的内容
    控制echarts 柱状图啊的柱条的宽度
    如何控制echartsY轴颠倒
    mac mysql nginx
    input textarea 获取焦点挡住输入法 解决办法
    react 记录
    微信内自动播放audio
    react router
    mysql 记录
    express 插件
  • 原文地址:https://www.cnblogs.com/tjudzj/p/9187447.html
Copyright © 2011-2022 走看看