spring-session 使用redis来存储session配置文件
2017-02-09 19:11
896 查看
<?xml version='1.0' encoding='UTF-8'?> <beans xmlns='http://www.springframework.org/schema/beans' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:util='http://www.springframework.org/schema/util' xsi:schemaLocation=' http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd '> <!--class="org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration"--> <bean name="redisHttpSessionConfiguration" class="com.liubin.study.session.redis.MyRedisHttpSessionConfiguration"> <!--session存在的时间--> <property name="maxInactiveIntervalInSeconds" value="180"/> <!--关闭redis的发布和订阅--> <property name="configureRedisAction"> <util:constant static-field="org.springframework.session.data.redis.config.ConfigureRedisAction.NO_OP"/> </property> <!--添加监听器--> <property name="httpSessionListeners"> <ref bean="httpSessionListeners"/> </property> </bean> <!--对于redis中的数据的序列化和反序列化--> <bean name="springSessionDefaultRedisSerializer" class="com.liubin.study.session.redis.Fastjson2JsonRedisSerializer"/> <!-- 对于sessionId存储的处理 (默认为Cookie存储) --> <!--使用cookie存储 <bean name="cookieHttpSessionStrategy" class="org.springframework.session.web.http.CookieHttpSessionStrategy"/> --> <!--使用http首部来存储 <bean name="headerHttpSessionStrategy" class="org.springframework.session.web.http.HeaderHttpSessionStrategy"/> --> <!--对于存储在redis中的session信息的监听--> <util:list id="httpSessionListeners"> <bean class="com.liubin.study.session.redis.listeners.BasicHttpSessionListener"/> </util:list> </beans>
相关文章推荐
- 使用Redis保存Spring session(基于XML配置文件)
- 使用Redis保存Spring session(基于XML配置文件)
- 使用redis代替文件存储session信息
- 使用Redis存储Nginx+Tomcat负载均衡集群的Session的详细配置
- Spring-Session配置,底层数据库使用Redis或Mysql
- Spring-Session配置,底层数据库使用Redis或Mysql
- spring-session使用配置redis
- Spring Boot配置Redis存储Session
- Asp.net Core中使用Redis 来保存Session, 读取配置文件
- 使用Spring配置文件实现AOP
- 配置ASP.NET网站使用AppFabric Caching存储Session数据
- 使用配置文件(.settings、.config)存储应用程序配置
- Spring中使用classpath加载配置文件浅析[转]
- spring的配置文件及使用
- Spring中使用classpath加载配置文件浅析
- 一个spring+hibernate开发的小程序的修改(其中配置文件使用的是HibernateSynchronizer插件生成)
- 使用配置文件(.settings、.config)存储应用程序配置
- Spring的Ioc简单使用实例(含XML配置文件路径知识)
- web 项目中 在spring中使用log4j 定时刷新log4j配置文件
- spring如何使用多个xml配置文件 【转】