天天看點

spring 配置加載外部檔案的兩種方式

第一種:

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

第二種:

<context:property-placeholder  location="classpath:config.properties"/>