zoukankan      html  css  js  c++  java
  • PropertyPlaceholderConfigurer的注意事项

    1、基本的使用方法是
    <bean id="propertyConfigurerForWZ" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> 
        <property name="location"> 
            <value>classpath:/spring/properties/jdbc.properties</value> 
        </property> 

    </bean>
    2、当存在多个Properties文件时
    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> 
        <property name="locations"> 
           <list> 
              <value>classpath:/spring/properties/jdbc.properties</value> 
              <value>/WEB-INF/conf/spring/system.properties</value> 
            </list> 
        </property> 
    </bean> 
    3、多个PropertyPlaceholderConfigurer要通过order属性指明加载顺序  
    <bean id="propertyConfigurerForWZ" class="org.springframework.beans.factory.
    config.PropertyPlaceholderConfigurer"> 
         <property name="order" value="1" /> 
        <property name="ignoreUnresolvablePlaceholders" value="true" /> 
        <property name="location"> 
           <value>classpath:/spring/include/dbQuery.properties</value> 
        </property> 
    </bean>
     <bean id="propertyConfigurerForWZ" class="org.springframework.beans.factory.
    config.PropertyPlaceholderConfigurer"> 
         <property name="order" value="2" /> 
        <property name="ignoreUnresolvablePlaceholders" value="true" /> 
        <property name="location"> 
           <value>classpath:/spring/include/dubbo.properties</value> 
        </property> 
    </bean>
  • 相关阅读:
    C# 类型的创建
    C# 中4个访问符和8个修饰符详解
    C#命名空间详解namespace
    ContextMenuStrip 添加在窗体。点击右键不能显示问题解答
    C# 学习笔记 C#基础
    React-Navigation web前端架构
    Css animation 与 float 、flex 布局问题
    javaScript 工作必知(十一) 数组常用方法实现
    Vue 父子组件传值 props
    kafka 参数配置 1
  • 原文地址:https://www.cnblogs.com/yuebintse/p/4136893.html
Copyright © 2011-2022 走看看