随笔分类 -  Spring

摘要:1 创建SpringApplication 保存部分信息 ClassUtils判定当前应用的类型,通常为Servlet Bootstrapper:初始启动引导器,去spring.factories文件中找Bootstrapper ApplicationContextInitializer:去spri 阅读全文
posted @ 2022-02-07 22:32 hunter-w 阅读(26) 评论(0) 推荐(0) 编辑
摘要:1 Profile功能 为了方便多环境适配,springboot简化了profile功能。 1.1 application-profile功能 默认配置文件 application.yaml,任何时候都会加载 指定环境配置文件 application-{env}.yaml 激活指定环境 配置文件激活 阅读全文
posted @ 2022-02-06 20:18 hunter-w 阅读(151) 评论(0) 推荐(0) 编辑
摘要:1 SpringBoot Actuator 1.1 简介 未来每一个微服务在云上部署以后,我们都需要对其进行监控、追踪、审计、控制等。SpringBoot就抽取了Actuator场景,使得我们每个微服务快速引用即可获得生产级别的应用监控、审计等功能。 <dependency> <groupId>or 阅读全文
posted @ 2022-02-04 21:35 hunter-w 阅读(80) 评论(0) 推荐(0) 编辑
摘要:1 Junit5 Spring Boot 2.2.0 版本开始引入 JUnit 5 作为单元测试默认库 作为最新版本的JUnit框架,JUnit5与之前版本的Junit框架有很大的不同。由三个不同子项目的几个不同模块组成。 JUnit 5 = JUnit Platform + JUnit Jupit 阅读全文
posted @ 2022-02-02 20:56 hunter-w 阅读(63) 评论(0) 推荐(0) 编辑
摘要:1 SQL 1.1 数据源的自动配置-HikariDataSource 1.1.1 导入JDBC场景 引入了Hikari数据源、jdbc、事务,但是没有导入驱动 <dependency> <groupId>org.springframework.boot</groupId> <artifactId> 阅读全文
posted @ 2022-01-23 23:15 hunter-w 阅读(48) 评论(0) 推荐(0) 编辑
摘要:1. SpringMVC自动配置概览 Spring Boot provides auto-configuration for Spring MVC that works well with most applications.(大多场景我们都无需自定义配置) The auto-configurati 阅读全文
posted @ 2022-01-12 23:17 hunter-w 阅读(60) 评论(0) 推荐(0) 编辑
摘要:1. 文件类型 1.1 properties 1.2 yaml 1.2.1 简介 YAML 是 "YAML Ain't Markup Language"(YAML 不是一种标记语言)的递归缩写。在开发的这种语言时,YAML 的意思其实是:"Yet Another Markup Language"(仍 阅读全文
posted @ 2022-01-09 17:35 hunter-w 阅读(33) 评论(0) 推荐(0) 编辑
摘要:1. 引导加载自动配置类 @SpringBootConfiguration @EnableAutoConfiguration @ComponentScan(excludeFilters = { @Filter(type = FilterType.CUSTOM, classes = TypeExclu 阅读全文
posted @ 2022-01-08 23:49 hunter-w 阅读(245) 评论(0) 推荐(0) 编辑
摘要:1. @Configuration Full模式与Lite模式 使用示例 /** * 1、配置类里面使用@Bean标注在方法上给容器注册组件,默认也是单实例的 * 2、配置类本身也是组件 * 3、proxyBeanMethods:代理bean的方法 * Full(proxyBeanMethods = 阅读全文
posted @ 2022-01-06 15:15 hunter-w 阅读(47) 评论(0) 推荐(0) 编辑
摘要:1. Spring与SpringBoot 1.1 Spring能做什么 微服务 响应式编程 云服务 Web开发 无服务(函数式开发) 事件驱动 批处理 1.2 SpringBoot与Spring关系 ​ SpringBoot简化配置,为高层框架,底层为Spring ​ 依赖关系:SpringBoot 阅读全文
posted @ 2021-12-26 23:02 hunter-w 阅读(45) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示