一、引入配置文件的方式:
方式一:
<context:property-placeholder location="classpath:jdbc.properties,classpath:dubbo.properties" />
方式二:
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath*:jdbc.properties</value> <value>classpath*:dubbo.properties</value> </list> </property> <property name="fileEncoding" value="UTF-8" /> <property name= "ignoreResourceNotFound" value="false"/> </bean>
方式三:
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="classpath:jdbc.properties" /> </bean>
参考: