依赖jar包:
Xml代码  收藏代码

    <!-- redis -->  
            <dependency>  
                <groupId>org.springframework.data</groupId>  
                <artifactId>spring-data-redis</artifactId>  
                <version>1.3.4.RELEASE</version>  
            </dependency>  
      
            <dependency>  
                <groupId>redis.clients</groupId>  
                <artifactId>jedis</artifactId>  
                <version>2.5.2</version>  
            </dependency>  

 applicationContext-cache-redis.xml

 
Xml代码  收藏代码

    <context:property-placeholder  
            location="classpath:/config/properties/redis.properties" />  
      
        <!-- 启用缓存注解功能,这个是必须的,否则注解不会生效,另外,该注解一定要声明在spring主配置文件中才会生效 -->  
        <cache:annotation-driven cache-manager="cacheManager" />  
      
        <!-- spring自己的换管理器,这里定义了两个缓存位置名称 ,既注解中的value -->  
        <bean ;  
                }  
            });  
        }  
      
    }

相关文章:

  • 2021-07-01
  • 2021-09-23
  • 2021-08-22
  • 2022-12-23
猜你喜欢
  • 2021-08-31
  • 2021-08-02
  • 2022-12-23
  • 2021-09-14
相关资源
相似解决方案