SpringBoot集成springsession
1. Introducing a dependent (Gradle embodiment)
dependencies { compile('org.springframework.boot:spring-boot-starter-data-redis') compile('org.springframework.session:spring-session-data-redis') }
2.application.properties attribute configuration file
# Specify the default session cache mode, redis, the need to configure redis omitted here spring.session.store-type = redis
3. Add configuration class, use @EnableRedisHttpSession to open the spring session support
@Configuration @EnableRedisHttpSession public class RedisSessionConfig { }