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>
  • 相关阅读:
    以一道CTF题目看无参数RCE
    浅谈php序列化字符串逃逸问题
    [XCTF 4th] ics-05 复现
    关于Sharp俩打印机AR-1808S和AR-2348SV的共享问题
    关于使用AdventureWorks2008示例数据库之初碰到的问题
    明日科技的SQL Server---6
    ado.net 4 step by step随书数据库
    手欠,大半个下午加一晚上就报销了。
    程序员的SQL金典
    c#读写文件
  • 原文地址:https://www.cnblogs.com/yuebintse/p/4136893.html
Copyright © 2011-2022 走看看