spring 配置文件 引入外部的property文件的兩種方法


spring  的配置文件

引入外部的property文件的兩種方法

<!-- 引入jdbc配置文件    方法一 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<!--要是有多個配置文件,只需在這里繼續添加即可 -->
<value>classpath:properties/*.properties</value>
</list>
</property>
</bean>

 

<!-- 引入jdbc配置文件    方法二 -->

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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM