zoukankan      html  css  js  c++  java
  • spring整合redis之Redis配置文件

    导包:jedis / spring-data-redis

    注意缓存穿透问题及缓存穿透解决办法

    需要 关闭Linux防火墙、将redis的配置文件中的protected-mode改为no,其Linux命令为:config set protected-mode no(进入配置文件命令:config get *)

    1.spring-redis.xml

     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <beans xmlns="http://www.springframework.org/schema/beans"
     3        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
     4        xsi:schemaLocation="http://www.springframework.org/schema/beans
     5         http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
     6 
     7     <mvc:default-servlet-handler/>
     8     <mvc:annotation-driven/>
     9 
    10 
    11     <mvc:annotation-driven>
    12         <mvc:message-converters>
    13             <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
    14                 <property name="objectMapper" ref="objectMapper"/>
    15             </bean>
    16         </mvc:message-converters>
    17     </mvc:annotation-driven>
    18 
    19     <bean id="objectMapper" class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean"/>
    20 
    21 
    22 </beans>
    历经苦难而不厌,此乃阿修罗之道。
  • 相关阅读:
    设计模式之观察者模式
    设计模式之外观模式
    设计模式之模板模式
    设计模式之装饰器模式
    设计模式之代理模式
    .NET常见问题汇总
    使用位运算计算两个整数的加减
    一个程序判断CPU是大端还是小端
    后缀表达式 转 表达式树
    实习一个月的小结
  • 原文地址:https://www.cnblogs.com/echo1314/p/10287029.html
Copyright © 2011-2022 走看看