欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

SpringBoot Session共享實(shí)現(xiàn)圖解

 更新時(shí)間:2020年01月02日 09:44:30   作者:鼓搗貓膩  
這篇文章主要介紹了SpringBoot Session共享實(shí)現(xiàn)圖解,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下

這篇文章主要介紹了SpringBoot Session共享實(shí)現(xiàn)圖解,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下

一、創(chuàng)建項(xiàng)目并導(dǎo)入依賴

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis-reactive</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency>

二、相關(guān)配置和代碼

  Application.properies

spring.redis.database=0
spring.redis.password=fernfei
spring.redis.host=192.168.21.130
spring.redis.port=6379
server.port=8080

Controller層

三、打包測試

雙擊打包,注意打包時(shí)把test跳過,點(diǎn)那個(gè)閃電就可以跳過測試

在cmd中運(yùn)行第一個(gè)項(xiàng)目

使用新版redis必須導(dǎo)入security,security訪問項(xiàng)目時(shí)需要登陸,用戶名user密碼

控制臺(tái)復(fù)制

再在cmd運(yùn)行第二個(gè)項(xiàng)目

效果圖

以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論