当前位置:首页>开发>正文

springboot怎么集成tomcat springboot 怎么集成redis

2023-04-14 16:22:04 互联网 未知 开发

 springboot怎么集成tomcat springboot 怎么集成redis

springboot怎么集成tomcat

在tomcat6版本中: 1、【官方文档】 在tomcatconf下server.xml中找到 在其中添加: 这的docBase要改成你的项目目录。 2、 不修改server.xml 在tomcat文件夹的conf"catalina"localhost(对于Tomcat6版本及其以上,

springboot 怎么集成redis

1、在pom文件中引入即可
org.springframework.boot spring-boot-starter-redis

2、编写一个CacheService接口,使用redisCacheServiceImpl实现这个接口
官网的原文是这样的,也就是说,提供三个接口注入和你自己实现的其他实现类,默认是本地端口号为6379的redis
You can inject an auto-configured RedisConnectionFactory, StringRedisTemplate or vanilla RedisTemplate instance as you would any other Spring Bean.By default the instance will attempt to connect to a Redis server using localhost:6379:

最新文章