spring.xml 配置加载jdbc.properties和ehcache.xml 的方法

来源:互联网 发布:java将链接生成二维码 编辑:程序博客网 时间:2024/05/16 18:57

spring 的配置文件中加载数据库的属性文件

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

 

配置 Hibernate的缓存文件

<bean id="cacheManager"
  class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
  <property name="configLocation">
   <value>classpath:ehcache.xml</value>
  </property>
 </bean>