您的位置:首页 > 编程语言 > Java开发

spring 加载非 类路径下的配置文件

2016-08-26 21:55 686 查看
[html] view
plain copy

<bean id="propertyConfigurer"  

    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">  

     <property name="locations">     

        <list>    

            <value>file:D:/workspace/test/conf/jdbc.properties</value>      

        </list>    

        </property>  

</bean>  

使用"file:"可以配置绝对路径,这样spring可以加载非类路径以外的资源文件;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: