Spring xml设置
来源:互联网 发布:c语言下载官方下载 编辑:程序博客网 时间:2024/06/03 02:44
<!-- 确保可在@Value中, 使用SeEL表达式获取资源属性 --><bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="properties" ref="configProperties" /></bean><bean id="configProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="locations"> <list> <value>classpath*:*.properties</value> </list> </property></bean>
用于自动读取如/test/resources/config/下的properties文件。
<context:component-scan base-package="com.baidu.fbu.fcore.accounting.loan" /><context:component-scan base-package="com.baidu.fbu.fcore.accounting" /><context:component-scan base-package="com.baidu.fbu.fcore.common" /><context:component-scan base-package="com.baidu.fbu.fcore.common.daycut" />
用于开启annotation自动扫描。
<!-- Imports --><import resource="classpath:META-INF/spring/accg-spring-mybatis.xml" /><import resource="classpath:META-INF/spring/accg-spring-cache.xml" /><import resource="classpath:META-INF/spring/accg-spring-jobs.xml" />
import其他xml配置文件。
cache.xml
<!-- Enable spring AOP --><aop:aspectj-autoproxy />
开启AOP。可以使用@AspectJ配置。
<!-- Cache key generator --><bean id="keyGenerator" class="com.baidu.fbu.fcore.common.cache.SignatureKeyGenerator" />
引入外部类的bean容器。
<!-- Cache manager --><cache:annotation-driven/><bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager"> <property name="caches"> <set> <bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="${accg.cache.name}" p:allowNullValues="false" /> <bean class="com.baidu.fbu.fcore.common.cache.RedisCache"> <property name="name" value="${daycut.cache.name}" /> <property name="ttl" value="${daycut.cache.ttl}"></property> </bean> </set> </property></bean>
引入cache部分,启用注解开启cache。
0 0
- Spring xml设置
- mybatis spring xml设置
- spring xml classpath 路径设置
- Spring设置定时器XML配置!
- spring应用中web.xml的设置
- spring应用中web.xml的设置
- Spring+Hibernate配置文件-applicationContext.xml设置
- Eclipse设置xml用spring编辑器打开的方法
- Spring XML设置bean的构造参数和属性方法
- Spring.xml
- spring.xml
- spring.xml
- spring xml
- spring xml
- spring-xml
- spring.xml
- Spring.xml
- spring.xml
- Linq中如何实现inner join、left join
- 整数在计算机中的编码
- 2016 ccpc网络赛
- sys/queue.h
- Linux网络监控工具netstat、sar
- Spring xml设置
- 第一次
- RabbitMq、ActiveMq、ZeroMq 和 kafka 比较
- 如何通过关键字和搜索结果分析用户需求
- ubuntu You might want to run 'apt-get -f install' to correct these:
- PAT-Sign In and Sign Out (25)
- mt7601驱动使用(二)
- c++中变量名和变量值
- oracle中如何修改process(进程)