`
sanry
  • 浏览: 35092 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

现有web系统替换成Spring Boot2框架 之9 session 共享

阅读更多

9.1 在pom.xml中配置依赖包

<!--spring boot 与redis应用基本环境配置 -->

<dependency>

    <groupId>org.springframework.boot</groupId>

    <artifactId>spring-boot-starter-data-redis</artifactId>

</dependency>

<!--spring session 与redis应用基本环境配置,需要开启redis后才可以使用,不然启动Spring boot会报错 -->

<dependency>

    <groupId>org.springframework.session</groupId>

    <artifactId>spring-session-data-redis</artifactId>

</dependency>

<!--jedis -->

<dependency>

    <groupId>redis.clients</groupId>

    <artifactId>jedis</artifactId>

    <version>2.9.0</version>

</dependency>

 

9.2 在application.properties中添加配置

# REDIS (RedisProperties)

# Redis服务器地址

spring.redis.host=localhost

# Redis服务器连接端口

spring.redis.port=6379

# Redis服务器连接密码(默认为空)

spring.redis.password=

# 连接池最大连接数(使用负值表示没有限制)

spring.redis.jedis.pool.max-active=20

# 连接池最大阻塞等待时间(使用负值表示没有限制)

spring.redis.jedis.pool.max-wait=-1

# 连接池中的最大空闲连接

spring.redis.jedis.pool.max-idle=15

# 连接池中的最小空闲连接

spring.redis.jedis.pool.min-idle=0

# 连接超时时间(毫秒)

spring.redis.timeout=1000

分享到:
评论

相关推荐

    Spring boot集成spring session实现session共享的方法

    主要介绍了Spring boot集成spring session实现session共享的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

    Spring Boot 2 Recipes

    获取Spring Boot 2微框架的可重用代码配方和代码段 了解Spring Boot 2如何与其他Spring API,工具和框架集成 访问Spring MVC和新的Spring Web Sockets,以实现更简单的Web开发 使用微服务进行Web服务开发并与Spring ...

    Pro Spring Boot 2第2版-2009-EPUB版

    Pro Spring Boot 2: An Authoritative Guide to Building Microservices, Web and Enterprise Applications, and Best Practices Quickly and productively develop complex Spring applications and microservices...

    spring Boot 2 精髓

    本书系统介绍了Spring Boot 2的主要技术,侧重于两个方面,一方面是极速开发一个Web应用系统,详细介绍Spring Boot框架、Spring MVC、视图技术、数据库访问技术,并且介绍多环境部署、自动装配、单元测试等高级特性...

    Spring Boot Redis Session 共享(Ajax 跨域)

    Spring Boot 使用 Redis 进行配置 Session 共享(Ajax 跨域) 源码下载。

    Spring Boot Redis Session 共享

    Spring Boot 使用 Redis 进行配置 Session 共享 源码下载。

    Spring Boot 2.X 实战教程.pdf

    本课程内容包括Spring简介、Spring Boot简介、安装JDK、安装Maven、第一个Spring Boot程序(使用Spring Initializr构建、Spring Boot代码讲解、安装Notepad++)、构建系统、代码、配置、三种方式运行程序、安装...

    Spring Boot 2精髓带书签目录高清版

    Spring Boot 2精髓带书签目录高清版,文字可复制,内容丰富,涵盖Spring Boot框架、Spring MVC、视图技术、数据库访问技术,并且介绍多环境部署、自动装配、单元测试等高级特性,包括使用Spring实现RESTful架构,在...

    Apress Beginning Spring Boot 2 PDF

    After reading and learning with Beginning Spring Boot 2, you'll have the skills and techniques to start building your first Spring Boot applications and microservices with confidence to take the next ...

    基于spring boot的spring cloud 开源框架

    最重要的是, 跟spring boot框架一起使用的话,会让你开发微服务架构的云服务非常好的方便。 SpringBoot旨在简化创建产品级的 Spring 应用和服务,简化了配置文件,使用嵌入式web服务器,含有诸多开箱即用微服务...

    基于spring boot框架的公司考勤系统的研究与设计.docx

    基于spring boot框架的公司考勤系统的研究与设计.docx基于spring boot框架的公司考勤系统的研究与设计.docx基于spring boot框架的公司考勤系统的研究与设计.docx基于spring boot框架的公司考勤系统的研究与设计.docx...

    基于Spring Boot 3.0、 Spring Cloud 2022 & Alibaba 的微服务RBAC 权限管理系统

    介绍一个基于Spring Boot 3.0、Spring Cloud 2022 & Alibaba的微服务RBAC权限管理系统。该系统可以实现微服务RBAC权限管理,通过RBAC权限管理机制对用户访问系统的权限进行限制,从而提高系统的安全性和可用性。同时...

    java课程设计基于Spring Boot框架的校园租赁管理系统.zip

    java课程设计基于Spring Boot框架的校园租赁管理系统。已获通过的高分项目。 软件架构 Spring boot +MySQL #####系统开发环境 IntelliJ IDEA 2020 + Maven 3 + Tomacat8 + MySQL+ jdk1.8 java课程设计基于Spring ...

    Spring Boot框架是一个用于构建任何类型应用程序的修改版Spring框架.pdf

    Spring Boot框架是一个用于构建任何类型应用程序的修改版Spring框架,它基于Java并提供了快速构建和启动应用程序的能力。Spring Boot框架通过自动配置和一系列预定义的特性,显著简化了Spring应用程序的开发过程。...

    Spring boot 示例 官方 Demo

    spring-boot-package-war:spring-boot打包成war包示例 spring-boot-shiro:springboot 整合shiro rbac示例 spring-boot-file-upload:使用Spring Boot 上传文件示例 spring-boot-fastDFS:Spring Boot 整合FastDFS...

    Spring Boot 2 Recipes: A Problem-Solution Approach

    Spring Boot 2 Recipes quickly introduces you to Pivotal's Spring Boot 2 micro-framework, then dives into code snippets on how to apply and integrate Spring Boot 2 with the Spring MVC web framework, ...

    spring boot 框架搭建 maven项目

    spring boot 框架搭建 maven项目

    spring boot实战教程之shiro session过期时间详解

    主要给大家介绍了关于spring boot实战教程之shiro session过期时间的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面来一起看看吧。

    spring boot 42讲配套源码.zip

    个人备份; 第 1-3 课 Spring Boot 依赖环境和项目结构介绍 第 1-4 课:写一个 Hello World 来感受 Spring Boot/hello ...第 2-9 课:Spring Boot 中使用 Swagger2 构建 RESTful APIs/spring-boot-sw

    spring_boot 框架代码原型设计

    spring_boot 框架代码原型设计spring_boot 框架代码原型设计

Global site tag (gtag.js) - Google Analytics