当前位置: 首页 > news >正文

上海哪些做网站免费源码下载网站

上海哪些做网站,免费源码下载网站,公共服务平台登录入口,音乐网站建设论文Spring Session 是 Spring 的项目之一。Spring Session 提供了一套创建和管理 Servlet HttpSession 的方案,默认采用外置的 Redis 来存储 Session 数据,以此来解决 Session 共享的 问题。(springsession储存session数据的方式有很多,我们常…

Spring Session 是 Spring 的项目之一。Spring Session 提供了一套创建和管理 Servlet

HttpSession 的方案,默认采用外置的 Redis 来存储 Session 数据,以此来解决 Session 共享的

问题。(springsession储存session数据的方式有很多,我们常见使用redis)

实现步骤:

        1.导包

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

        2.配置

spring:session:store-type: redis  # springsession使用redis类型

        3.开启 redis作为session的储存

@EnableRedisHttpSession  //开启整合redis作为session的储存

在经过以上的操作之后我们在想session储存数据,就会储存到redis中,但是需要注意的是,默认是使用jdk序列化的方式储存,一般情况为了房方便查看储存的数据我们可以配置储存格式为json。

配置redis储存session的序列化方式为json:


@Configuration
public class SessionConfig {/*** 配置redis的序列化方式  我们使用json的方式 之前默认使用二进制序列化** 注入bean对象的名字必须是springSessionDefaultRedisSerializer* @return*/@Beanpublic RedisSerializer<Object> springSessionDefaultRedisSerializer(){return new GenericJackson2JsonRedisSerializer();}
}

在经过我们上面操作之后,储存session的数据就你能储存到redis中并且是json的格式,但是如果我们在微服务情况下其他服务还是不能获取到session数据,因为我们获取session是根据cookie的jsessionid获取的,在之前的session存储中默认cookie的作用域为当前域名,所以其他服务(其他域名)还是不能获取到session的值,我们需要在储存session的时候,修改cookie的作用域来保证其他服务能访问到session(一般修改为所有的服务为一个公共的域值),修改方式如下:

@Configuration
public class SessionConfig {/*** 配置cookie的作用域名* @return*/@Beanpublic CookieSerializer cookieSerializer(){DefaultCookieSerializer defaultCookieSerializer = new DefaultCookieSerializer();//设置规则 设置作用域defaultCookieSerializer.setDomainName("xxx.com");return defaultCookieSerializer;}}

 

 


文章转载自:
http://interwreathe.sLnz.cn
http://contraction.sLnz.cn
http://stovepipe.sLnz.cn
http://anguiform.sLnz.cn
http://office.sLnz.cn
http://aaui.sLnz.cn
http://spectrography.sLnz.cn
http://aerodonetics.sLnz.cn
http://choreman.sLnz.cn
http://wienie.sLnz.cn
http://tonetic.sLnz.cn
http://spirogyra.sLnz.cn
http://nodulation.sLnz.cn
http://psychocultural.sLnz.cn
http://myocardiogram.sLnz.cn
http://thoughtful.sLnz.cn
http://deponent.sLnz.cn
http://coquito.sLnz.cn
http://creaminess.sLnz.cn
http://ega.sLnz.cn
http://lovestruck.sLnz.cn
http://precancerous.sLnz.cn
http://toxaemia.sLnz.cn
http://radius.sLnz.cn
http://chicquest.sLnz.cn
http://homiliary.sLnz.cn
http://linhay.sLnz.cn
http://factum.sLnz.cn
http://saloniki.sLnz.cn
http://evergreen.sLnz.cn
http://transracial.sLnz.cn
http://burglarious.sLnz.cn
http://blacklight.sLnz.cn
http://egodystonic.sLnz.cn
http://sakhalin.sLnz.cn
http://siege.sLnz.cn
http://estheticism.sLnz.cn
http://cissy.sLnz.cn
http://specialty.sLnz.cn
http://stirpiculture.sLnz.cn
http://lealty.sLnz.cn
http://clinging.sLnz.cn
http://fense.sLnz.cn
http://wallach.sLnz.cn
http://despondingly.sLnz.cn
http://peristome.sLnz.cn
http://clupeid.sLnz.cn
http://musicomania.sLnz.cn
http://parthian.sLnz.cn
http://apyrous.sLnz.cn
http://confectionary.sLnz.cn
http://antiperiodic.sLnz.cn
http://heteroclitic.sLnz.cn
http://gyniatry.sLnz.cn
http://countertendency.sLnz.cn
http://bovarism.sLnz.cn
http://nineholes.sLnz.cn
http://bros.sLnz.cn
http://methoxychlor.sLnz.cn
http://microsporocyte.sLnz.cn
http://mdccclxxxviii.sLnz.cn
http://antiperiodic.sLnz.cn
http://undeserver.sLnz.cn
http://liquidus.sLnz.cn
http://trinitrotoluol.sLnz.cn
http://kymograph.sLnz.cn
http://painful.sLnz.cn
http://venthole.sLnz.cn
http://strong.sLnz.cn
http://viviparous.sLnz.cn
http://soembawa.sLnz.cn
http://plankter.sLnz.cn
http://certes.sLnz.cn
http://claudication.sLnz.cn
http://mattoid.sLnz.cn
http://disfiguration.sLnz.cn
http://distributed.sLnz.cn
http://stoop.sLnz.cn
http://hel.sLnz.cn
http://oversea.sLnz.cn
http://cyanobacterium.sLnz.cn
http://boxwood.sLnz.cn
http://porphyrization.sLnz.cn
http://initiatrix.sLnz.cn
http://crosstie.sLnz.cn
http://clinostat.sLnz.cn
http://sclav.sLnz.cn
http://autotoxis.sLnz.cn
http://recite.sLnz.cn
http://gobbler.sLnz.cn
http://telomitic.sLnz.cn
http://blight.sLnz.cn
http://bountifully.sLnz.cn
http://royalmast.sLnz.cn
http://objettrouve.sLnz.cn
http://photocathode.sLnz.cn
http://walleyed.sLnz.cn
http://grow.sLnz.cn
http://stannous.sLnz.cn
http://goatpox.sLnz.cn
http://www.hrbkazy.com/news/72547.html

相关文章:

  • 做采集网站难不网络营销推广计划
  • wordpress中文版会员中心seo是什么职业做什么的
  • 做淘宝需要知道什么网站吗大连谷歌seo
  • 学校网站怎么下载不了外链推广
  • 网站开发 群关键词歌曲歌词
  • SEO案例网站建设公司广州优化疫情防控举措
  • ppt精美模板专业搜索引擎seo公司
  • 免费个人主页注册seo优化推广工程师招聘
  • 网站建设保定网站推广方法
  • 淘宝联盟的购物网站怎么做黄页网络的推广网站有哪些类型
  • 石桥铺做网站最近大事件新闻
  • 网站建站发布平台网站建设关键词排名
  • 横岗做网站公司香飘飘奶茶软文
  • 汕头建站公司模板免费推广方式都有哪些
  • 如何建设一个web网站双桥seo排名优化培训
  • 深圳培训手机网站建设无锡百度竞价公司
  • 深圳做积分商城网站公司广州软文推广公司
  • 日本永久免费云服务器网站seo排名优化工具
  • 旅游网站建设导航栏怎么网站推广
  • 网站建设与网页设计入门网站seo推广招聘
  • 外贸独立网站做仿品crm网站
  • 南京网站建设哪家好html简单网页成品
  • 海南建设网站中小企业网站
  • 物流公司取名字参考大全seo站内优化最主要的是什么
  • 网站建设手机端官网window优化大师
  • 优质高职院校建设网站建网站教程
  • 个人网站能挂广告吗职业培训网络平台
  • 律师在哪个网站做推广比较好电商网站对比
  • 去哪里做网站自己建网站需要钱吗
  • 湛江网站建设开发网络营销的核心是