spring mvc ehcache 详细配置 亲测可用
1.废话不多说首先配置spring pom.xml 添加dependency <dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache</artifactId> <version>2.9.0</version> </dependency> maven在打包时候会自动从网上下载对应的jar包。 2.写一个ehcache配置文件 ehcache-context.xml (名字可以随便起不过后面要引入) <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:cache="http://www.springframework.org/schema/cache" xsi:schemaLocation=" http://www.springframework.org/schema/context http://www.springframework.org