You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.8 KiB
30 lines
1.8 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
|
|
xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
|
|
xmlns:context="http://www.springframework.org/schema/context"
|
|
xmlns:websocket="http://www.springframework.org/schema/websocket"
|
|
xmlns:cache="http://www.springframework.org/schema/cache"
|
|
xsi:schemaLocation="
|
|
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
|
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
|
|
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
|
|
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
|
|
http://www.springframework.org/schema/websocket http://www.springframework.org/schema/websocket/spring-websocket.xsd
|
|
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd">
|
|
|
|
<!-- 启用缓存注解功能,这个是必须的,否则注解不会生效,另外,该注解一定要声明在spring主配置文件中才会生效 -->
|
|
<cache:annotation-driven cache-manager="cacheManager" />
|
|
|
|
|
|
<!-- ===========================spring cache 基于 ehcache 的实现============================= -->
|
|
<!-- cacheManager工厂类,指定ehcache.xml的位置 -->
|
|
<!-- EhCache library setup -->
|
|
<bean id="ehcache"
|
|
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
|
|
p:configLocation="classpath:ehcache.xml" />
|
|
|
|
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"
|
|
p:cacheManager-ref="ehcache" />
|
|
|
|
</beans>
|
|
|