第2.3.1章 WEB系统最佳实践属性配置之ehcache.xml
2016-10-24 19:28
459 查看
ehcache.xml里面主要是配置缓存的名称和策略,另外就是缓存存放的路径。
windows、linux下面支持这种方式
第2.1.7章 WEB系统最佳实践Spring文件配置之spring-shiro.xml引用的就是下面配置的属性
注意上面
windows、linux下面支持这种方式
<diskStore path="/usr/local/cache/monitorcache"/>,但是mac电脑不支持。
第2.1.7章 WEB系统最佳实践Spring文件配置之spring-shiro.xml引用的就是下面配置的属性
<?xml version="1.0" encoding="UTF-8"?> <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="true" monitoring="autodetect" dynamicConfig="true"> <diskStore path="/usr/local/cache/monitorcache"/> <!-- 登录记录缓存 锁定10分钟 --> <cache name="passwordRetryEhcache" maxEntriesLocalHeap="2000" eternal="false" timeToIdleSeconds="3600" timeToLiveSeconds="0" overflowToDisk="false" statistics="true"> </cache> <cache name="authorizationCache" maxEntriesLocalHeap="2000" eternal="false" timeToIdleSeconds="3600" timeToLiveSeconds="0" overflowToDisk="false" statistics="true"> </cache> <cache name="authenticationCache" maxEntriesLocalHeap="2000" eternal="false" timeToIdleSeconds="3600" timeToLiveSeconds="0" overflowToDisk="false" statistics="true"> </cache> <cache name="shiro-activeSessionCache" maxEntriesLocalHeap="2000" eternal="false" timeToIdleSeconds="3600" timeToLiveSeconds="0" overflowToDisk="false" statistics="true"> </cache> <defaultCache maxElementsInMemory="1000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" maxElementsOnDisk="10000" diskSpoolBufferSizeMB="30" diskPersistent="false" diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU" statistics="false" /> </ehcache>
注意上面
<diskStore path="/usr/local/cache/monitorcache"/>这段缓存路径的配置,在windows和linux都可以,但是mac电脑不会自行创建,会提示如下异常。路径就得自己创建了。
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcacheManager' defined in file [/Users/cbb/Documents/workspace/fofweb/fofeasy/target/classes/spring/spring-cache.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Could not create cache directory "/usr/local/cache/fofeasycache". at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359
相关文章推荐
- 第2.1.3章 WEB系统最佳实践Spring文件配置之spring-dao.xml
- 第2.1.5章 WEB系统最佳实践Spring文件配置之spring-mvc.xml
- 第2.1.1章 WEB系统最佳实践Spring文件配置之spring-cache.xml
- 第2.3.3章 WEB系统最佳实践属性配置之shiro.properties
- 第2.1.6章 WEB系统最佳实践Spring文件配置之spring-hessian-client.xml
- 第2.3.2章 WEB系统最佳实践属性配置之jdbc.properties
- 第2.1.4章 WEB系统最佳实践Spring文件配置之spring-hessian-server.xml
- 第2.1.7章 WEB系统最佳实践Spring文件配置之spring-shiro.xml
- 第2.3章 WEB系统最佳实践属性配置
- 第2.1.8章 WEB系统最佳实践Spring文件配置之spring-email.xml
- 第2.1.9章 WEB系统最佳实践Spring文件配置之spring-dubbo.xml
- 第2.1.2章 WEB系统最佳实践Spring文件配置之spring-common.xml
- 第2.1.10章 WEB系统最佳实践Spring文件配置多数据源
- 第2.1章 WEB系统最佳实践Spring文件配置
- Spring 总结用XML配置的十二个最佳实践 收藏
- 轻量级单点登录系统最佳实践(八)——5.3. 企业门户系统系统演示SSOLab.Portal.WebApp
- web.xml中配置session属性
- 开发框架:Spring XML配置十二个最佳实践
- Web前端开发最佳实践(5):正确闭合HTML标签,停止使用不标准的标签和属性
- Web前端开发最佳实践(12):JavaScript代码中有大量写死的配置数据?这些数据难以维护,你需要合理组织这些数据