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语言实现按层次(广度优先)非递归遍历二叉链树
    三、初学.NET—Gridview的分页
    五、初学.NET—Gridview自动编号和鼠标停留行加背景
    四、初学.NET—Gridview外部按钮选中、删除一行
    二、初学.NET—Gridview的排序
    一、初学.NET—数据库连接字符串
    .net web study
    C# 接口
    c#索引器
  • 原文地址:https://www.cnblogs.com/yuebintse/p/4136893.html
Copyright © 2011-2022 走看看