Similarly Spring’s support for property placeholder provides the flexibility to read application specific properties from externalized property files to configure various spring managed beans.
Mixing the two is pretty easy, and requires just a simple setup to push required ehcache configuration properties from spring property files into system properties using a technique explained here
See sample artifacts on GitHub, which include
- sample ehcache xml
- spring application context
- spring app properties and
- a Spring test class that depends on a spring managed Cache bean
See code below