spring读取properties和xml配置文件的方法
2009-01-05 15:46
931 查看
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>
<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>
相关文章推荐
- SpringBoot内部配置:“application.properties配置”和”使用XML配置”,读取属性文件中的内容,日志配置,Profile配置(学习:SpringBoot实战)
- 读取Spring的配置文件applicationContext.xml的5种方法
- Spring ClassPathXmlApplicationContext和FileSystemXmlApplicationContext读取配置文件的方法
- spring的xml配置文件读取properties文件中的属性
- Spring中配置和读取多个Properties文件的方式方法
- Spring配置 在xml和java代码中读取properties文件
- Spring afterPropertiesSet方法读取系统配置文件实例
- 读取Spring的配置文件applicationContext.xml几种方法
- java读取配置文件 xml properties的几种方法
- spring基于xml加载和读取properties配置文件的方式
- Java开发中读取XML与properties配置文件的方法
- 读取Spring的配置文件applicationContext.xml几种方法
- (转) spring配置文件(xml)读取properties文件属性值
- 读取Spring的配置文件applicationContext.xml的5种方法
- 读取Spring的配置文件applicationContext.xml的5种方法
- 读取Spring配置文件ApplicationContext.xml的5种方法
- Spring-property文件配置方法以及如何与工程分离~xml使用${}
- Spring读取properties文件出现乱码的解决方法
- java读取.properties配置文件的几种方法
- Spring: 读取 .properties 文件地址,json转java对象,el使用java类方法相关 (十三)