spring boot之session store type is 'null'


在網上搜索之后,發現session store type使用來存放session的存儲方式,目前Spring boot中只支持Redis方式。 由於本應用暫無需將session放入redis的需求,故這里就可以將session store type設置為none.

 這里我們將此配置信息放入application.properites之中:

# default-store in spring session. it will be set in redis only outside.

spring.session.store-type=none

再次啟動,成功。

如果使用redis存儲session:

application.properties配置

spring.session.store-type=redis
加入redis配置:

spring.redis.database=0 spring.redis.host=localhost spring.redis.password= spring.redis.pool.max-active=8 spring.redis.pool.max-idle=8 spring.redis.pool.max-wait=-1 spring.redis.pool.min-idle=0 spring.redis.port=6379


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM