application.xml中配置文件properties导入

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

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

这样之后可以在其中使用properties中的属性,通过${}的方式引入。

posted @ 2018-08-13 14:49  俄而123  阅读(1846)  评论(0编辑  收藏  举报