- 浏览: 933421 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (423)
- mysql (37)
- hibernate (3)
- struts (9)
- spring (33)
- dom4j (2)
- junit (0)
- exception (1)
- 随笔杂谈 (12)
- google app engine (1)
- XMPP (1)
- OAuth安全授权 (1)
- 版本控制 (8)
- 心情感悟 (0)
- core java (19)
- log4j (7)
- jquery (12)
- javascript (10)
- 网站性能优化及工具 (11)
- 服务器架设配置等 (38)
- EXT (4)
- 正则表达式 (5)
- 日志统计分析 (2)
- htmlparse (4)
- httpclient (5)
- java随笔 (5)
- dhtmlxtree (1)
- freemarke (5)
- memcached (6)
- javamail (5)
- Linux命令 (10)
- 应用监控cpu web jdbc等 (4)
- jmagick (9)
- 第三方缓存策略 (9)
- ORM (2)
- hadoop (2)
- 大数据量处理 (8)
- 经典 (1)
- 权限设计 (1)
- andriod (1)
- mybatis (12)
- redis (24)
- 数据结构_算法 (5)
- 分布式系统 (1)
- php (1)
- 网络编程 (3)
- 服务器部署 (3)
- ios (2)
- IM (23)
- mina (1)
- 视讯和语音 (1)
- 代码生成 (1)
- 架构 (4)
- 建模工具 (1)
- oracle (4)
- solr (10)
- 构建工具 (7)
- html5 (1)
- nginx (5)
- css (1)
- 大数据-分布式 (2)
- 设计模式 (2)
- mq (2)
- jvm调优 (8)
- 并发编程 (2)
- 搜索引擎 (1)
- UML (2)
最新评论
-
天使建站:
jquery获取网页里多选框checkbox选中项的值的方法及 ...
JS jQuery分别获取选中的复选框值 -
abao1:
发现一个小问题 sortAndSave方法中的for循环 第二 ...
完整java实现外部排序 -
西巴拉古呀那:
Kafka分布式消息系统实战(与JavaScalaHadoop ...
消息系统kafka介绍 -
kafodaote:
Kafka分布式消息系统实战(与JavaScalaHadoop ...
消息系统kafka介绍 -
成大大的:
Kafka分布式消息系统实 ...
消息系统kafka介绍
本文将构建一个普通工程来说明spring注解缓存的使用方式,关于如何在web应用中使用注解缓存,请参见:
一.简介
在spring的modules包中提供对许多第三方缓存方案的支持,包括:
EHCache
OSCache(OpenSymphony)
JCS
GigaSpaces
JBoss Cache
等等。
将这些第三方缓存方案配置在spring中很简单,网上有许多介绍,这里只重点介绍如何配置基于注解的缓存配置。
本文将通过例举EHCache和OSCache详细介绍如何使用spring配置基于注解的缓存配置,注意这里的缓存是方法级的。
二.依赖
在开始介绍如何进行缓存配置前先介绍一下EHCache和OSCache的jar依赖。
EHCache:
ehcache-core-1.7.2.jar
jakarta-oro-2.0.8.jar
slf4j-api-1.5.8.jar
slf4j-jdk14-1.5.8.jar
OSCache:
oscache-2.4.1.jar
此外,两者都需要的jar如下:
cglib-nodep-2.1_3.jar
commons-logging.jar
log4j-1.2.15.jar
spring-modules-cache.jar
spring.jar
三.配置
两种缓存在spring配置文件中都可以使用两种配置方式,一种是spring2.0以前的完全基于bean的复杂配置,一种是使用后来的基于命名空间的简单配置,两种配置效果相同,分别介绍如下:
EHCache:
1)普通配置
- <? xml version = "1.0" encoding = "UTF-8" ?>
- < beans xmlns = "http://www.springframework.org/schema/beans"
- xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation ="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd">
- <!-- aop代理,这个是必须地,否则缓存不起作用 -->
- < bean id = "autoproxy"
- class = "org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" />
- <!-- EhCache 管理工厂 用于指定ehcache配置文件路径 -->
- < bean id = "cacheManager"
- class = "org.springframework.cache.ehcache.EhCacheManagerFactoryBean" >
- < property name = "configLocation" value = "classpath:ehcache.xml" />
- </ bean >
- < bean id = "cacheProviderFacade" class = "org.springmodules.cache.provider.ehcache.EhCacheFacade" >
- < property name = "cacheManager" ref = "cacheManager" />
- </ bean >
- <!-- 1.5+ Annotation 基于注解查找被缓存的业务方法 -->
- < bean id = "cachingAttributeSource"
- class = "org.springmodules.cache.annotations.AnnotationCachingAttributeSource" > </ bean >
- <!-- 缓存拦截器:定义了缓存模块,ehcache只需要指定配置文件中的缓存名称 -->
- < bean id = "cachingInterceptor"
- class = "org.springmodules.cache.interceptor.caching.MetadataCachingInterceptor" >
- < property name = "cacheProviderFacade" ref = "cacheProviderFacade" />
- < property name = "cachingAttributeSource" ref = "cachingAttributeSource" />
- < property name = "cachingModels" >
- < props >
- < prop key = "testCaching" > cacheName = testCache </ prop >
- </ props >
- </ property >
- </ bean >
- <!-- 基于注解查找缓存业务方法的AOP通知器 -->
- < bean id = "cachingAttributeSourceAdvisor"
- class = "org.springmodules.cache.interceptor.caching.CachingAttributeSourceAdvisor" >
- < constructor-arg ref = "cachingInterceptor" />
- </ bean >
- <!-- 基于注解查找触发缓存刷新动作的业务方法 -->
- < bean id = "flushingAttributeSource"
- class = "org.springmodules.cache.annotations.AnnotationFlushingAttributeSource" > </ bean >
- <!-- 刷新拦截器:定义了刷新策略,基于那个模块ID,刷新相应的缓存 -->
- < bean id = "flushingInterceptor"
- class = "org.springmodules.cache.interceptor.flush.MetadataFlushingInterceptor" >
- < property name = "cacheProviderFacade" ref = "cacheProviderFacade" />
- < property name = "flushingAttributeSource" ref = "flushingAttributeSource" />
- < property name = "flushingModels" >
- < map >
- < entry key = "testFlushing" >
- < bean
- class = "org.springmodules.cache.provider.ehcache.EhCacheFlushingModel" >
- < property name = "cacheNames" >
- < list >
- < value > testCache </ value >
- </ list >
- </ property >
- <!-- 报错,应该是不能直接设置cacheName
- < property name = "cacheName" value = "testCache" />
- -->
- </ bean >
- </ entry >
- </ map >
- </ property >
- </ bean >
- <!-- 基于注解查找刷新缓存业务方法的AOP通知器 -->
- < bean id = "flushingAttributeSourceAdvisor"
- class = "org.springmodules.cache.interceptor.flush.FlushingAttributeSourceAdvisor" >
- < constructor-arg ref = "flushingInterceptor" />
- </ bean >
- <!-- 测试对象 -->
- < bean id = "testCache" class = "com.TestCache" />
- </ beans >
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <!-- aop代理,这个是必须地,否则缓存不起作用 --> <bean id="autoproxy" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" /> <!-- EhCache 管理工厂 用于指定ehcache配置文件路径 --> <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"> <property name="configLocation" value="classpath:ehcache.xml" /> </bean> <bean id="cacheProviderFacade" class="org.springmodules.cache.provider.ehcache.EhCacheFacade"> <property name="cacheManager" ref="cacheManager" /> </bean> <!-- 1.5+ Annotation 基于注解查找被缓存的业务方法 --> <bean id="cachingAttributeSource" class="org.springmodules.cache.annotations.AnnotationCachingAttributeSource"></bean> <!-- 缓存拦截器:定义了缓存模块,ehcache只需要指定配置文件中的缓存名称 --> <bean id="cachingInterceptor" class="org.springmodules.cache.interceptor.caching.MetadataCachingInterceptor"> <property name="cacheProviderFacade" ref="cacheProviderFacade" /> <property name="cachingAttributeSource" ref="cachingAttributeSource" /> <property name="cachingModels"> <props> <prop key="testCaching">cacheName=testCache</prop> </props> </property> </bean> <!-- 基于注解查找缓存业务方法的AOP通知器 --> <bean id="cachingAttributeSourceAdvisor" class="org.springmodules.cache.interceptor.caching.CachingAttributeSourceAdvisor"> <constructor-arg ref="cachingInterceptor" /> </bean> <!-- 基于注解查找触发缓存刷新动作的业务方法 --> <bean id="flushingAttributeSource" class="org.springmodules.cache.annotations.AnnotationFlushingAttributeSource"></bean> <!-- 刷新拦截器:定义了刷新策略,基于那个模块ID,刷新相应的缓存 --> <bean id="flushingInterceptor" class="org.springmodules.cache.interceptor.flush.MetadataFlushingInterceptor"> <property name="cacheProviderFacade" ref="cacheProviderFacade" /> <property name="flushingAttributeSource" ref="flushingAttributeSource" /> <property name="flushingModels"> <map> <entry key="testFlushing"> <bean class="org.springmodules.cache.provider.ehcache.EhCacheFlushingModel"> <property name="cacheNames"> <list> <value>testCache</value> </list> </property> <!-- 报错,应该是不能直接设置cacheName <property name="cacheName" value="testCache"/> --> </bean> </entry> </map> </property> </bean> <!-- 基于注解查找刷新缓存业务方法的AOP通知器 --> <bean id="flushingAttributeSourceAdvisor" class="org.springmodules.cache.interceptor.flush.FlushingAttributeSourceAdvisor"> <constructor-arg ref="flushingInterceptor" /> </bean> <!-- 测试对象 --> <bean id="testCache" class="com.TestCache"/> </beans>
2)命名空间配置
- <? 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:ehcache = "http://www.springmodules.org/schema/ehcache"
- xsi:schemaLocation ="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springmodules.org/schema/ehcache http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd">
- <!-- 这里可以不需要配置这个
- < bean id = "autoproxy" class = "org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" />
- -->
- < ehcache:config configLocation = "classpath:ehcache.xml"
- id = "cacheProvider" />
- < ehcache:annotations providerId = "cacheProvider" >
- < ehcache:caching cacheName = "testCache" id = "testCaching" />
- < ehcache:flushing cacheNames = "testCache" id = "testFlushing" />
- </ ehcache:annotations >
- < bean id = "testCache" class = "com.TestCache" />
- </ beans >
<?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:ehcache="http://www.springmodules.org/schema/ehcache" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springmodules.org/schema/ehcache http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd"> <!-- 这里可以不需要配置这个 <bean id="autoproxy" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" /> --> <ehcache:config configLocation="classpath:ehcache.xml" id="cacheProvider" /> <ehcache:annotations providerId="cacheProvider"> <ehcache:caching cacheName="testCache" id="testCaching" /> <ehcache:flushing cacheNames="testCache" id="testFlushing" /> </ehcache:annotations> <bean id="testCache" class="com.TestCache"/> </beans>
OSCache:
1)普通配置
- <? xml version = "1.0" encoding = "UTF-8" ?>
- < beans xmlns = "http://www.springframework.org/schema/beans"
- xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation ="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd">
- <!-- 这个是必须地,否则缓存不起作用 -->
- < bean id = "autoproxy"
- class = "org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" />
- <!-- 缓存管理工厂:使用OSCache缓存管理,配置了OSCache使用的配置文件路径 -->
- < bean id = "cacheManager"
- class = "org.springmodules.cache.provider.oscache.OsCacheManagerFactoryBean" >
- < property name = "configLocation" value = "classpath:oscache.properties" />
- </ bean >
- <!-- 缓存提供:OSCache -->
- < bean id = "cacheProviderFacade" class = "org.springmodules.cache.provider.oscache.OsCacheFacade" >
- < property name = "cacheManager" ref = "cacheManager" />
- </ bean >
- <!-- 1.5+ Annotation 基于注解查找被缓存的业务方法 -->
- < bean id = "cachingAttributeSource"
- class = "org.springmodules.cache.annotations.AnnotationCachingAttributeSource" > </ bean >
- <!-- 缓存拦截器:定义了缓存模块,以及相应的刷新策略,以及缓存所属群组 -->
- < bean id = "cachingInterceptor"
- class = "org.springmodules.cache.interceptor.caching.MetadataCachingInterceptor" >
- < property name = "cacheProviderFacade" ref = "cacheProviderFacade" />
- < property name = "cachingAttributeSource" ref = "cachingAttributeSource" />
- < property name = "cachingModels" >
- < props >
- < prop key = "testCaching" > refreshPeriod = 86400 ; cronExpression = 0 1 * * *; groups = pb_test </ prop >
- </ props >
- </ property >
- </ bean >
- <!-- 基于注解查找缓存业务方法的AOP通知器 -->
- < bean id = "cachingAttributeSourceAdvisor"
- class = "org.springmodules.cache.interceptor.caching.CachingAttributeSourceAdvisor" >
- < constructor-arg ref = "cachingInterceptor" />
- </ bean >
- <!-- 基于注解查找触发缓存刷新动作的业务方法 -->
- < bean id = "flushingAttributeSource"
- class = "org.springmodules.cache.annotations.AnnotationFlushingAttributeSource" > </ bean >
- <!-- 刷新拦截器:定义了刷新策略,基于那个模块ID,刷新相应的缓存群组 -->
- < bean id = "flushingInterceptor"
- class = "org.springmodules.cache.interceptor.flush.MetadataFlushingInterceptor" >
- < property name = "cacheProviderFacade" ref = "cacheProviderFacade" />
- < property name = "flushingAttributeSource" ref = "flushingAttributeSource" />
- < property name = "flushingModels" >
- < props >
- < prop key = "testFlushing" > groups = pb_test </ prop >
- </ props >
- </ property >
- </ bean >
- <!-- 基于注解查找刷新缓存业务方法的AOP通知器 -->
- < bean id = "flushingAttributeSourceAdvisor"
- class = "org.springmodules.cache.interceptor.flush.FlushingAttributeSourceAdvisor" >
- < constructor-arg ref = "flushingInterceptor" />
- </ bean >
- < bean id = "testCache" class = "com.TestCache" />
- </ beans >
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <!-- 这个是必须地,否则缓存不起作用 --> <bean id="autoproxy" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" /> <!-- 缓存管理工厂:使用OSCache缓存管理,配置了OSCache使用的配置文件路径 --> <bean id="cacheManager" class="org.springmodules.cache.provider.oscache.OsCacheManagerFactoryBean"> <property name="configLocation" value="classpath:oscache.properties" /> </bean> <!-- 缓存提供:OSCache --> <bean id="cacheProviderFacade" class="org.springmodules.cache.provider.oscache.OsCacheFacade"> <property name="cacheManager" ref="cacheManager" /> </bean> <!-- 1.5+ Annotation 基于注解查找被缓存的业务方法 --> <bean id="cachingAttributeSource" class="org.springmodules.cache.annotations.AnnotationCachingAttributeSource"></bean> <!-- 缓存拦截器:定义了缓存模块,以及相应的刷新策略,以及缓存所属群组 --> <bean id="cachingInterceptor" class="org.springmodules.cache.interceptor.caching.MetadataCachingInterceptor"> <property name="cacheProviderFacade" ref="cacheProviderFacade" /> <property name="cachingAttributeSource" ref="cachingAttributeSource" /> <property name="cachingModels"> <props> <prop key="testCaching">refreshPeriod=86400;cronExpression=0 1 * * *;groups=pb_test</prop> </props> </property> </bean> <!-- 基于注解查找缓存业务方法的AOP通知器 --> <bean id="cachingAttributeSourceAdvisor" class="org.springmodules.cache.interceptor.caching.CachingAttributeSourceAdvisor"> <constructor-arg ref="cachingInterceptor" /> </bean> <!-- 基于注解查找触发缓存刷新动作的业务方法 --> <bean id="flushingAttributeSource" class="org.springmodules.cache.annotations.AnnotationFlushingAttributeSource"></bean> <!-- 刷新拦截器:定义了刷新策略,基于那个模块ID,刷新相应的缓存群组 --> <bean id="flushingInterceptor" class="org.springmodules.cache.interceptor.flush.MetadataFlushingInterceptor"> <property name="cacheProviderFacade" ref="cacheProviderFacade" /> <property name="flushingAttributeSource" ref="flushingAttributeSource" /> <property name="flushingModels"> <props> <prop key="testFlushing">groups=pb_test</prop> </props> </property> </bean> <!-- 基于注解查找刷新缓存业务方法的AOP通知器 --> <bean id="flushingAttributeSourceAdvisor" class="org.springmodules.cache.interceptor.flush.FlushingAttributeSourceAdvisor"> <constructor-arg ref="flushingInterceptor" /> </bean> <bean id="testCache" class="com.TestCache"/> </beans>
2)命名空间配置
- <? 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:oscache = "http://www.springmodules.org/schema/oscache"
- xsi:schemaLocation ="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springmodules.org/schema/oscache http://www.springmodules.org/schema/cache/springmodules-oscache.xsd">
- <!-- 这里可以不需要配置这个
- < bean id = "autoproxy" class = "org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" />
- -->
- < oscache:config configLocation = "classpath:oscache.properties" id = "cacheProvider" />
- < oscache:annotations providerId = "cacheProvider" >
- < oscache:caching id = "testCaching" groups = "pb_test" cronExpression = "0 1 * * *" refreshPeriod = "86400" />
- < oscache:flushing id = "testFlushing" groups = "pb_test" />
- </ oscache:annotations >
- < bean id = "testCache" class = "com.TestCache" />
- </ beans >
<?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:oscache="http://www.springmodules.org/schema/oscache" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springmodules.org/schema/oscache http://www.springmodules.org/schema/cache/springmodules-oscache.xsd"> <!-- 这里可以不需要配置这个 <bean id="autoproxy" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" /> --> <oscache:config configLocation="classpath:oscache.properties" id="cacheProvider"/> <oscache:annotations providerId="cacheProvider"> <oscache:caching id="testCaching" groups="pb_test" cronExpression="0 1 * * *" refreshPeriod="86400"/> <oscache:flushing id="testFlushing" groups="pb_test"/> </oscache:annotations> <bean id="testCache" class="com.TestCache"/> </beans>
四.注解
@Cacheable:声明一个方法的返回值应该被缓存
例如:@Cacheable(modelId = "testCaching")
@CacheFlush:声明一个方法是清空缓存的触发器
例如:@CacheFlush(modelId = "testCaching")
五.测试
这是用使用一个带有main函数的类来进行测试,代码如下:
- /*
- * COPYRIGHT Beijing NetQin-Tech Co.,Ltd. *
- ****************************************************************************
- * 源文件名: TestCache.java
- * 功能: (描述文件功能)
- * 版本: @version 1.0
- * 编制日期: 2010-2-24
- * 说明: (描述使用文件功能时的制约条件)
- * 修改历史: (主要历史变动原因及说明)
- * YYYY-MM-DD | Author | Change Description
- * 2010-2-24 | hanqunfeng | Created
- */
- package com;
- import net.sf.ehcache.CacheManager;
- import org.springframework.context.ApplicationContext;
- import org.springframework.context.support.ClassPathXmlApplicationContext;
- import org.springmodules.cache.annotations.CacheFlush;
- import org.springmodules.cache.annotations.Cacheable;
- import com.opensymphony.oscache.general.GeneralCacheAdministrator;
- public class TestCache {
- /**
- * 描述 : <描述函数实现的功能>. <br>
- *<p>
- * @param args
- */
- static String context = null ;
- static ApplicationContext applicationContext;
- static {
- context = "applicationContext-ehcache.xml" ; //ehcache简单配置(命名空间)
- // context = "applicationContext-ehcache_full.xml";//ehcache完整配置
- // context = "applicationContext-oscache.xml";//oscache简单配置(命名空间)
- // context = "applicationContext-oscache_full.xml";//oscache完整配置
- applicationContext = new ClassPathXmlApplicationContext(context);
- }
- public static void main(String[] args) {
- TestCache test = (TestCache)applicationContext.getBean("testCache" );
- System.out.println(test.getName(0 ));
- System.out.println(test.getName(0 ));
- System.out.println(test.getName(0 ));
- test.flush();
- // test.OSFlushAll();
- // test.EHFlushAll();
- System.out.println(test.getName(0 ));
- System.out.println(test.getName(0 ));
- System.out.println(test.getName(0 ));
- }
- @Cacheable (modelId = "testCaching" )
- public String getName( int i){
- System.out.println("Processing testCaching" );
- return "nihao:" +i;
- }
- @CacheFlush (modelId = "testFlushing" )
- public void flush(){
- System.out.println("Processing testFlushing" );
- }
- /**
- * 描述 : <OSCache刷新全部缓存>. <br>
- *<p>
- 问 题:flushAll() 后不会再缓存数 据
-
<span class=
发表评论
-
各种数据库(oracle、mysql、sqlserver等)在Spring中数据源的配置和JDBC驱动包
2013-07-16 13:09 2784在开发基于数据库的应 ... -
springmvc rest框架搭建中遇到的问题-xml转换错误
2013-01-18 11:26 1966.bean to xml显示的xml不是我往Model ... -
spring3.5 mvc json view bug MappingJacksonJsonView
2013-01-18 11:27 1513在返回单一model的json的时候。 MappingJa ... -
Spring MVC的多视图解析器配置及与Freemarker的集成
2013-01-18 11:27 3646http://my249645546.iteye.com/ ... -
xStream完美转换XML、JSON
2013-01-17 16:02 1213http://www.cnblogs.com/hoojo/a ... -
SpringMVC 中整合JSON、XML视图一
2013-01-17 16:01 1324http://www.cnblogs.com/hoojo/a ... -
Spring MVC 之 视图解析器ResourceBundleViewResolver
2013-01-17 10:45 1247http://blog.csdn.net/q34982 ... -
spring3mvc自定义多视图解析器
2013-01-17 10:41 1634使用视图名后缀来判断选择相应的视图解析器自定义一个视图解析器 ... -
spring3.0.6 使用context:property-placeholder载不进属性
2012-12-15 14:43 1349我用spring3.0.6+mybatis3.0.6+myba ... -
Spring定时任务的多种使用方法总结
2012-10-18 09:48 1690这里使用的是Spring2.5,需要的jar包:spring. ... -
Spring3.0 + 自定义注解实现操作日志记录功能
2012-03-12 09:34 1455最近项目组长分配给我一个任务,让我完成一个操作日志的管理功能。 ... -
spring mvc例子
2012-03-11 11:35 2045使用拦截器 和Struts2一样,Spring MVC也可以 ... -
在 Spring Bean 內取得 HttpServletRequest
2011-10-11 16:13 1185使用 Java 去開發 Web 應用程式時,大部份時候都會使用 ... -
spring3+freemark自定义标签
2011-10-09 18:27 2718<bean id="viewResolver& ... -
OpenSessionInViewFilter作用及配置
2011-06-15 10:31 1310摘自:http://www.yybean.com/opense ... -
spring httpinvoke 例子
2011-04-21 17:15 1176http://ajava.org/course/open/11 ... -
使用 ActiveMQ 示例
2011-03-30 17:38 1332企业中各项目中相互协作的时候可能用得到消息通知机制。比如有 ... -
使用Spring HTTP invoker进行远程调用
2011-03-30 10:34 1667使用Spring HTTP invoker进行远程调用Spri ... -
Java Spring2.5 Remote Invoke HTTP Invoker远程调用
2011-03-30 08:42 1919近日,一个项目涉及到系统间接口调用,考虑到系统间用的都是j ... -
Spring AOP不能拦截同一个对象内方法的嵌套调用
2011-03-30 08:27 2260在开发基于 Spring 的应用的过程中碰到了一个 ...
相关推荐
基于java的开发源码-ehcache(Java缓存框架 EhCache).zip 基于java的开发源码-ehcache(Java缓存框架 EhCache).zip 基于java的开发源码-ehcache(Java缓存框架 EhCache).zip 基于java的开发源码-ehcache(Java缓存框架 ...
基于java的开发源码-Ehcache Java 缓存框架.zip 基于java的开发源码-Ehcache Java 缓存框架.zip 基于java的开发源码-Ehcache Java 缓存框架.zip 基于java的开发源码-Ehcache Java 缓存框架.zip 基于java的开发源码-...
Mybatis-ehcache 1.2.1源码(ehcache-cache-mybatis-ehcache-1.2.1.tar.gz)
Mybatis-ehcache 1.2.1源码(ehcache-cache-mybatis-ehcache-1.2.1.zip)
基于java的开发源码-缓存框架Ehcache.zip
在\ehcache-monitor-kit-1.0.0\etc\ehcache-monitor.conf中可以配置监控的ip和端口号。 4.启动被监控的web application和ehcache-monitor-kit-1.0.0\bin目录下的startup.bat(在windows环境下) 5.在浏览器中输入 ...
cas-client-support-distributed-ehcache-3.2.0.jar
缓存 ehcache-1.3.0.rar 缓存 ehcache-1.3.0.rar 缓存 ehcache-1.3.0.rar 缓存 ehcache-1.3.0.rar
shiro-demo使用ehcache做缓存.zip
1.通过google ehcache-spring-annotatios.jar自动注解方式实现整合Spring+Ehcache。 2.Action里通过struts2-spring-plugin.jar插件自动根据名字注入。 3.Ajax无刷新异步调用Struts2,返回Json数据,以用户注册为例。...
本例子主要讲解ehcache的配置使用。采用了java配置和xml配置两种方式。主要用于学习。 使用java配置时将SpringTestCase.java 文件中的@ContextConfiguration(locations = { "classpath:applicationContext.xml" }) ...
缓存框架-ehcache架构图
shiftone-cache swarmcache ehcache jcs 源码 你们懂得 很好的cache
基于Java的源码-ehcache(Java缓存框架 EhCache).zip
ehcache全解析 利用Spring和EHCache缓存结果 Hibernate+ehcache二级缓存技术 Spring基于注解的缓存配置--web应用实例 http://zjava.org.ru/
两级缓存在redis的方案上做一步优化,在缓存到远程redis的同时,缓存一份到本地进程ehcache(此处的ehcache不用做集群,避免组播带来的开销),取缓存的时候会先取本地,没有会向redis请求,这样会减少应用服务器<–...
spring3整合EhCache注解实例
NULL 博文链接:https://cuisuqiang.iteye.com/blog/2050675
本例子主要讲解ehcache的配置使用。采用了java配置和xml配置两种方式。主要用于学习。 使用java配置时将SpringTestCase.java 文件中的@ContextConfiguration(locations = { "classpath:applicationContext.xml" }) ...