zoukankan      html  css  js  c++  java
  • ehcache 缓存使用

     一:详细配置步骤

         1,添加ehcache.xml文件

          将ehcache.xml文件添加到src路径下面。ehcache.xml文件内容如下

    1. <ehcache>  
    2.     <diskStore path="java.io.tempdir" />  
    3.     <defaultCache maxElementsInMemory="1000" eternal="false"  
    4.         timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" />  
    5.     <cache name="ehcacheName" maxElementsInMemory="10000"  
    6.         eternal="false" timeToIdleSeconds="300000" timeToLiveSeconds="600000"  
    7.         overflowToDisk="true" />  
    8. </ehcache>  

         2,添加spring配置文件

         在applicContext.xml文件中添加

    1.    <bean id="cacheManagerFactory"  
    2.     class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"  
    3.     p:configLocation="classpath:ehcache.xml"></bean>  
    4.   
    5. <!-- 声明cacheManager -->  
    6. <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"   
    7.     p:cacheManager-ref="cacheManagerFactory" ></bean>  
  • 相关阅读:
    JavaScript数据类型和变量学习小记
    如何在windows下安装Python的PIL库
    maoguy的第一条博客
    Ⅲ. 通过git管理github上托管的代码
    Ⅱ. Git的本地操作--下(不会使github远程仓库发生任何改变)
    Ⅰ. Git的本地操作--上(不会使github远程仓库发生任何改变)
    Linux下Vi/Vim编辑器使用案例(基于Ubuntu)
    Selenium+python上传本地文件或者图片
    Selenium+python操作id为动态变化的frame(iframe)
    Quick-cocos2d-x v3.3 SocketTCP链接(转)
  • 原文地址:https://www.cnblogs.com/jpfss/p/8276158.html
Copyright © 2011-2022 走看看