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>
  • 相关阅读:
    iOS 中UI控件的各种对齐方式总结
    BLE 广播数据解析
    Objective-C中一种消息处理方法performSelector: withObject:
    ios的@property属性和@synthesize属性
    iOS中的字符串扫描类NSScanner
    iOS开发技巧(系列十八:扩展UIColor,支持十六进制颜色设置)
    NSMakeRange基础函数应用
    Objective-C中的占位符,打印BOOL类型数据
    NSUInteger和NSInteger和int
    HDU4870:Rating(DP)
  • 原文地址:https://www.cnblogs.com/yuebintse/p/4136893.html
Copyright © 2011-2022 走看看