码迷,mamicode.com
首页 > 编程语言 > 详细

Spring 小知识点

时间:2018-02-17 22:06:28      阅读:311      评论:0      收藏:0      [点我收藏+]

标签:class   jdbc   col   factory   ace   property   cat   path   classpath   

一、引入配置文件的方式:

方式一:

<context:property-placeholder location="classpath:jdbc.properties,classpath:dubbo.properties" />

 方式二:

<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <list>
            <value>classpath*:jdbc.properties</value>
            <value>classpath*:dubbo.properties</value>
        </list>
    </property>
    <property name="fileEncoding" value="UTF-8" />
    <property name= "ignoreResourceNotFound" value="false"/>
</bean>

方式三:

<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="location" value="classpath:jdbc.properties" />
</bean>

 

参考:

Spring 小知识点

标签:class   jdbc   col   factory   ace   property   cat   path   classpath   

原文地址:https://www.cnblogs.com/happyflyingpig/p/8452222.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!