4

ehcache 3.x版本需要将缓存保存在磁盘中时如何指定磁盘路径。可以在ehcache 2.x版本中指定<diskStore path="java.io.tmpdir/ehcache/" />,但我在3.x版本中没有找到任何等效的xml标记。

4

2 回答 2

2

经过长时间的分析,我终于发现 3.x 中的等效 xml 标签是<persistence directory="java.io.tmpdir/ehcache/" />

于 2019-03-27T16:14:51.300 回答
1

您必须将“java.io.tmpdir”作为变量引用:

<persistence directory="${java.io.tmpdir}/ehcache/" />

于 2020-09-15T10:45:57.223 回答