ehcache.xml can't use the properties file property

二次信任 提交于 2019-12-13 17:14:47

问题


I define a system.properties in my class path, then I do like this in spring configuration xml:

<context:property-placeholder location="classpath*:/system.properties" ignore-resource-not-found="true" ignore-unresolvable="true" />

I aslo defind ehcache like this :

<cache:annotation-driven cache-manager="cacheManager" />

    <bean id="ehCacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
        <property name="configLocation" value="classpath:/ehcache.xml" />
        <property name="shared" value="true" />
    </bean>

    <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
        <property name="cacheManager" ref="ehCacheManager" />
    </bean>

I define a properties in system.properties file :

system.project_name=myproject

ehcache.xml like this :

<diskStore path="e:/${system.project_name}/cache" />

I want use the system.project_name property to store the cache, but when I deploy my project, I find the Directory is:

that is say I could't use the properties even I define a PropertyPlaceholderConfigurer in Spring configuration xml file?

来源:https://stackoverflow.com/questions/21190955/ehcache-xml-cant-use-the-properties-file-property

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!