当前位置: 代码迷 >> 综合 >> springMVC+ehcache @Cacheabale失效
  详细解决方案

springMVC+ehcache @Cacheabale失效

热度:7   发布时间:2023-12-14 18:26:30.0

这两天做缓存发现@Cacheable没有用,之前用过配置一样没有变动,不过之前用的是spring+ehcache,然后移植到springMVC中的时候却不起效果!发现假如spring-mvc.xml和spring-ehcache,xml分开来配置的话

下面注解一定在两个配置文件中都加上

<cache:annotation-driven/> 所以,如果Spring 和 Spring MVC的配置文件是分开的,最好把<cache:annotation-driven/>在两边都加上。

 

  相关解决方案