spring boot 实际应用(六) session共享问题

    xiaoxiao2021-03-25  104

    目前使用spring-session redis 实现session共享问题

    1、添加依赖

     

    <dependency>  <groupId>org.springframework.session</groupId>  <artifactId>spring-session-data-redis</artifactId>  </dependency>

    2、添加 RedisSessionConfig package com.ecej.uc.config; import org.springframework.context.annotation.Configuration; import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; @Configuration @EnableRedisHttpSession public class RedisSessionConfig { } 具体redis配置请看 《spring boot实际应用(五) redis》 更多文章尽在公众号,计划每天推出一篇小结
    转载请注明原文地址: https://ju.6miu.com/read-13997.html

    最新回复(0)