本篇文章為大家展示了SpringBoot中怎么實(shí)現(xiàn)共享Session,內(nèi)容簡(jiǎn)明扼要并且容易理解,絕對(duì)能使你眼前一亮,通過(guò)這篇文章的詳細(xì)介紹希望你能有所收獲。
一、創(chuàng)建項(xiàng)目并導(dǎo)入依賴(lài)
<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=0spring.redis.password=fernfeispring.redis.host=192.168.21.130spring.redis.port=6379server.port=8080
Controller層
三、打包測(cè)試
雙擊打包,注意打包時(shí)把test跳過(guò),點(diǎn)那個(gè)閃電就可以跳過(guò)測(cè)試
在cmd中運(yùn)行第一個(gè)項(xiàng)目
使用新版redis必須導(dǎo)入security,security訪(fǎng)問(wèn)項(xiàng)目時(shí)需要登陸,用戶(hù)名user密碼
控制臺(tái)復(fù)制
再在cmd運(yùn)行第二個(gè)項(xiàng)目
上述內(nèi)容就是SpringBoot中怎么實(shí)現(xiàn)共享Session,你們學(xué)到知識(shí)或技能了嗎?如果還想學(xué)到更多技能或者豐富自己的知識(shí)儲(chǔ)備,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
分享題目:SpringBoot中怎么實(shí)現(xiàn)共享Session-創(chuàng)新互聯(lián)
標(biāo)題URL:http://www.2m8n56k.cn/article24/dghece.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供做網(wǎng)站、微信小程序、全網(wǎng)營(yíng)銷(xiāo)推廣、網(wǎng)站收錄、網(wǎng)頁(yè)設(shè)計(jì)公司、網(wǎng)站內(nèi)鏈
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:[email protected]。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容
營(yíng)銷(xiāo)型網(wǎng)站建設(shè)知識(shí)