SpringBoot-redis-session
2024-09-04 16:19:16
配置pom
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency>
或
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session</artifactId>
</dependency>
@SpringBootApplication
@EnableRedisHttpSession
public class App
{
public static void main( String[] args ){
SpringApplication.run(App.class, args);
}
}
注:如果使用 spring-session-data-redis 依赖方式,不需要加入@EnableRedisHttpSession
配置applicaton.yml
spring:
redis:
host: 192.168.99.100
port: 6379
password: a123
最新文章
- :before :after
- 5分钟windows wamp php安装phpunit 2015最新安装实践
- 根据显示的字符多少来做Label的自适应高度
- 区间dp笔记√
- java 类从哪个jar包加载的
- Write a beautiful button
- PHP IDE 框架 服务器 相关
- 在网页中使用javascript提供反馈信息
- .NET和JAVA 反射对比
- poj 3687 Labeling Balls(拓补排序)
- flex 1与flex auto
- SDWebImage之SDWebImageDownloaderOperation
- idea模板注释
- Spring 整合 Junit4 进行单元测试
- EF中的预先加载和延迟加载
- Thinkphp 缓存和静态缓存局部缓存设置
- 三个支持正则表达式的行处理的工具: grep/sed/awk
- 使用InputStreamReader读入,使用OutputStreamWriter写出,将一首诗按行重写?
- OOM问题定位方法
- fold change的意义[转载]