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中的属性,通过${}的方式引入。

原文地址:https://www.cnblogs.com/eer123/p/9468059.html