I am using Ehcache + Hibernate + Spring with an ehcache.xml file. I would like to parameterize ehc开发者_如何学Pythonache.xml with stuff from a properties file at runtime. Does anyone know an easy way to do this?
That depends on what sort of config you're talking about. ehcache.xml
contains some global config (e.g. the location of the disk-overflow directory), as well as cache-specific config.
If you're talking about the latter, then you can use Spring's EhCache support (i.e. EhCacheFactoryBean
and EhCacheManagerFactoryBean
) to configure and manage EhCache instances.
If you're talking about the global config, though, I don't there's a way.
精彩评论