spring 引入properties文件

来源:互联网 发布:知乎社会网络分析 编辑:程序博客网 时间:2024/04/30 07:25

方法1:

<context:property-placeholder location="classpath:com/dispatch/db.properties"/>

方法2:

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:com/dispatch/db.properties</value>
            </list>
        </property>

</bean>


转自:http://blog.sina.com.cn/s/blog_76519a4801011j7d.html

0 0