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>  
  • 相关阅读:
    php 将英文引号成对转换为中文引号
    centos 6.2 x86_64 编译安装 httpd2.4.2时,apr报错
    PHP在通过非HTTP方式或多客户端的情况下,session的共享
    用c链接mysql
    多进程和多线程有什么区别
    进程和线程的区别
    linux中重要数据声明
    春节后返校第三天
    窗外下着雨——来到南京的第一篇
    中断门与陷阱门的区别
  • 原文地址:https://www.cnblogs.com/jpfss/p/8276158.html
Copyright © 2011-2022 走看看