• 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>
    历经苦难而不厌,此乃阿修罗之道。
  • 相关阅读:
    筛选法求素数
    C/C++经典面试题目
    操作系统笔试面试基本内容
    Win32/MFC的基本概念
    STL采用的标准模板库
    数据结构基本概念
    SQL基础语句
    C/C++基础概念
    计算机网络基础概念
    流水作业 批作业调度
  • 原文地址:https://www.cnblogs.com/echo1314/p/10287029.html
Copyright © 2020-2023  润新知