随笔分类 -  springboot

摘要:9、Web原生组件注入(Servlet、Filter、Listener) 1、使用Servlet API @ServletComponentScan(basePackages = "com.atguigu.admin") :指定原生Servlet组件都放在那里 @WebServlet(urlPatt 阅读全文
posted @ 2021-03-01 17:38 lovelifest 阅读(55) 评论(0) 推荐(0)
摘要:一、Spring的缓存抽象 1.1、缓存抽象定义 Spring从3.1开始定义了org.springframework.cache.Cache 和org.springframework.cache.CacheManager接口来统一不同的缓存技术;并支持使用Java Caching(JSR-107) 阅读全文
posted @ 2021-02-23 11:39 lovelifest 阅读(110) 评论(0) 推荐(1)
摘要:Spring Boot 中自定义事件监听 自定义事件 在实际项目中,我们往往需要自定义一些事件和监听器来满足业务场景,比如在微服务中会有这样的场景:微服务 A 在处理完某个逻辑之后,需要通知微服务 B 去处理另一个逻辑,或者微服务 A 处理完某个逻辑之后,需要将数据同步到微服务 B。这种场景非常普遍 阅读全文
posted @ 2021-02-23 10:45 lovelifest 阅读(125) 评论(0) 推荐(0)
摘要:原图链接:https://www.processon.com/view/link/59812124e4b0de2518b32b6e 本文的分析基于Spring Boot 2.1.5,非Spring的代码只有下面这个启动main函数: @SpringBootApplication public cla 阅读全文
posted @ 2021-02-22 19:54 lovelifest 阅读(270) 评论(0) 推荐(0)
摘要:4、数据响应与内容协商 1、响应JSON 1.1、jackson.jar+@ResponseBody <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artif 阅读全文
posted @ 2021-02-18 14:33 lovelifest 阅读(54) 评论(0) 推荐(0)
摘要:1、SpringMVC自动配置概览 Spring Boot provides auto-configuration for Spring MVC that works well with most applications.(大多场景我们都无需自定义配置) The auto-configuratio 阅读全文
posted @ 2021-02-07 17:28 lovelifest 阅读(91) 评论(0) 推荐(0)
摘要:1.2.1、简介 YAML 是 "YAML Ain't Markup Language"(YAML 不是一种标记语言)的递归缩写。在开发的这种语言时,YAML 的意思其实是:"Yet Another Markup Language"(仍是一种标记语言)。 非常适合用来做以数据为中心的配置文件 1.2 阅读全文
posted @ 2021-02-04 14:24 lovelifest 阅读(185) 评论(0) 推荐(0)
摘要:1.1、依赖管理 父项目做依赖管理 依赖管理 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.4.RELEASE 阅读全文
posted @ 2021-01-29 15:55 lovelifest 阅读(182) 评论(0) 推荐(0)