方法一:利用org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
<bean id="propertyConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:test.properties</value>
</list>
</property>
<property name="fileEncoding" value="UTF-8"/>
</bean>
方法二:利用context:property-placeholder
<context:property-placeholder location="classpath:test.properties" file-encoding="utf-8"/>
原文地址:https://www.cnblogs.com/caohui/p/9767026.html
时间: 2024-10-12 10:59:12