Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ehcache 3.x版本需要将缓存保存在磁盘中时如何指定磁盘路径。可以在ehcache 2.x版本中指定<diskStore path="java.io.tmpdir/ehcache/" />,但我在3.x版本中没有找到任何等效的xml标记。
<diskStore path="java.io.tmpdir/ehcache/" />
经过长时间的分析,我终于发现 3.x 中的等效 xml 标签是<persistence directory="java.io.tmpdir/ehcache/" />
<persistence directory="java.io.tmpdir/ehcache/" />
您必须将“java.io.tmpdir”作为变量引用:
<persistence directory="${java.io.tmpdir}/ehcache/" />