1
是否可以在ehcache.xml中注入一些屬性?如何在ehcache配置文件中注入屬性?
例如,我有不同的屬性文件,每個屬於一個環境:
my_project_name.local.properties
my_project_name.test.properties
my_project_name.int.properties
my_project_name.prod.properties
它們中的每含性質不同的環境。
我想在ehcache.xml中的屬性maxByteslocalHeap
如下注入:
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd"
updateCheck="false" monitoring="autodetect"
maxBytesLocalHeap="${my_project.cache.maxBytesLocalHeap}">
.....
</ehcache>
my_project.cache.maxBytesLocalHeap
在上述所示的各屬性文件中定義的,並且具有根據在我的應用程序運行環境不同的值。