<context:property-placeholder location= "Classpath: Config.properties "/><!-- single Redis configuration --><bean class=" Org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration "/> <bean id= "Poolconfig" class= "Redis.clients.jedis.JedisPoolConfig" > <property name= "Maxidle" value= "${redis.maxidle}" /> <property name= "Maxtotal" value= "${redis.maxactive}" /> <property name= "Maxwaitmillis" value= "${redis.maxwait}" /> <property name= "Testonborrow" value= "${redis.testonborrow}" /></bean ><bean class= "Org.springframework.data.redis.connection.jedis.JedisConnectionFactory" >< Property name= "HostName" value= "${redis.host}"/><Property name= "Port" value= "${redis.port}"/><property name= "password" value= "${ Redis.pass} "/><property name=" Database " value=" ${redis.db} "/><property name=" Timeout " value=" "/><property name=" Poolconfig " ref=" Poolconfig "/></bean> <!-- Place session into Redis --><bean id= "Redishttpsessionconfiguration" class= " Org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration "> !-- session expiry time--> <property name= " Maxinactiveintervalinseconds " value=" 1 " /></bean>web.xml <filter> < filter-name>springsessionrepositoryfilter</filter-name> <filter-class>org.springframework.web.filter.delegatingfilterproxy</filter-class> </filter> < Filter-mapping> <filter-name> springsessionrepositoryfilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Later detailed
Spring Redis Session Configuration