使用PropertyPlaceholderConfigurer可以在XML配置文件中加入外部属性文件

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

  <!-- 该属性是在PropertyPlaceholderConfigurer的祖父类里面-->

        <property name="locations">

  <value>classpath:hibernate.properties</value>

  </property>

  </bean>

猜你喜欢

转载自ronymo.iteye.com/blog/2174703
今日推荐