• 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>
  • 相关阅读:
    java中分页对象类
    java日期处理类DateUtil
    java日期处理类DateUtil
    Java Socket编程
    MySQL中TIMESTAMPDIFF和TIMESTAMPADD函数的用法
    java中用SAX方式解析xml文件
    First Demo
    软件测试面试/笔试题题库(知识的搬运工,不谢!)
    2017年 6月29 开始博客园之旅--愿自己变得更强大!
    DUIEngine使用Visual Studio 2010编译Debug_Dll版有关Error MSB3073错误解决方案
  • 原文地址:https://www.cnblogs.com/yuebintse/p/4136893.html
Copyright © 2020-2023  润新知