在ehcache中将另一个缓存作为默认值

时间:2013-07-14 19:39:12

标签: java ehcache

如何使ehcache.xml中声明的另一个缓存默认为<defaultCache/>元素。

<ehcache>
  <!-- <defaultCache xxxxxx /> -->
   <cache name="mynewDefault" />
</ehcache>

现在我想将mynewDefault作为默认缓存。请注意defaultCache已注释。

1 个答案:

答案 0 :(得分:0)

每当您向CacheManager添加缓存时都会使用defaultCache-Properties,而缓存未放置在配置中。在您的情况下,设置只适用于名为“mynewDefault”的缓存。只需更改属性,一切都应该按照您想要的方式工作。