SpringBoot启动类增加注解
@EnableRedisHttpSession
@SpringBootApplication
@ImportResource({"classpath:config/applicationContext-xweb-dubbo.xml"
        ,"classpath:config/applicationContext-xweb.xml"
        ,"classpath:config/applicationContext-jedis.xml"})
@Configuration
@ComponentScan
@EnableRedisHttpSession
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class, RedisAutoConfiguration.class})
public class XwebApplication extends WebMvcConfigurerAdapter {

}

application.properties
spring.redis.host=192.16.8.126
spring.redis.port=6379
spring.redis.password=cor2017
pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>1.1.0.RELEASE</version>
<type>pom</type>
</dependency>

 

相关文章:

  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
  • 2021-12-29
  • 2021-05-24
  • 2021-11-03
猜你喜欢
  • 2021-11-30
  • 2021-12-27
  • 2021-04-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
相关资源
相似解决方案