首页 > 编程语言 > 详细

Spring 小知识点

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

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

方式一:

<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 小知识点

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!