随笔分类 -  spring

摘要:**springboot 整合注解切换数据源** 1、Spring Boot的配置文件 ``` # 数据源1 spring.datasource.druid.one.url=jdbc:mysql://localhost:3306/db1 spring.datasource.druid.one.use 阅读全文
posted @ 2023-09-01 17:09 Ai喝咖啡Demo 阅读(271) 评论(0) 推荐(0)
摘要:Spring Boot中整合Ehcache 添加Ehcache依赖: ``` net.sf.ehcache ehcache --根据需要选择版本。 2.10.6 ``` 配置Ehcache Spring Boot项目的application.properties文件中添加以下配置: ``` # Eh 阅读全文
posted @ 2023-09-01 16:53 Ai喝咖啡Demo 阅读(243) 评论(0) 推荐(0)
摘要:Spring Boot 可以与 Apache Kafka 集成: 添加 Maven 依赖: Spring Boot 项目的 pom.xml 文件中添加以下 Maven 依赖: <dependency> <groupId>org.springframework.kafka</groupId> <art 阅读全文
posted @ 2023-09-01 16:48 Ai喝咖啡Demo 阅读(97) 评论(0) 推荐(0)
摘要:1.自定义拦截器 spring mvc拦截器根spring拦截器相比,它里面能够获取HttpServletRequest和HttpServletResponse等web对象实例。 spring mvc拦截器的顶层接口是:HandlerInterceptor,包含三个方法: 1.2)preHandle 阅读全文
posted @ 2023-07-11 18:15 Ai喝咖啡Demo 阅读(25) 评论(0) 推荐(0)
摘要:**Spring Boot自带的工具类** 来源:https://baijiahao.baidu.com/s?id=1767377176417069985 一、Assert 类(断言) 1.断言是一个逻辑判断,用于检查不应该发生的情况 2.Assert 关键字在 JDK1.4 中引入,可通过 JVM 阅读全文
posted @ 2023-07-11 15:01 Ai喝咖啡Demo