File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # SpringBoot
2+
3+ ## 简介
4+
5+ SpringBoot 是由 pivotal 团队开发的全新的Spring 框架,其设计初衷是简化 Spring 应用复杂的搭建和开发过程。该框架提供了一套简单的 Spring 模块依赖和管理工具,从而避免了开发人员处理复杂的模块依赖和版本冲突问题,同事提供打包即可用 Web 服务。
6+
7+ SpringBoot 特点如下:
8+
9+ - 快速创建独立的 Spring 应用程序
10+ - 嵌入 Tomcat Web 容器,可快速部署。
11+ - 自动配置 JAR 包依赖和版本控制,简化 Maven 配置
12+ - 自动装配 Spring 实例,不需要 XML 配置
13+ - 提供诸如性能指标、健康检查、外部配置等线上监控和配置功能。
14+
15+ ## 常用注解
16+
17+ ### @SpringBootApplication
18+
19+ Spring Boot 项目的基石,创建 SpringBoot 项目之后会默认在主类加上。
20+
21+ @SpringBootApplication 可以认为是 @Configuration 、@EnableAutoConfiguration 和 @ComponentScan 注解的集合。其中
22+
23+ - @EnableAutoConfiguration :启用 SpringBoot 的自动配置机制
24+ - @ComponentScan : 扫描被 @Component / @Service / @Controller 注解的 Bean,注解默认会扫描该类所在的包下所有的类。
25+ - @Configuration :允许在 Spring 上下文中注册额外的 Bean 或导入其他配置类
26+
27+ ### @Value & @ ConfigurationProperties & @PropertySource
28+
29+ 通过 @Value ("${property}") 读取比较简单的配置信息;
30+
31+ 通过 @ConfigurationProperties 读取配置信息并与 bean 绑定;
32+
33+ 通过 @PropertySource 读取指定 properties 文件。
34+
35+ ### @ControllerAdvice & @ExceptionHandler
36+
37+ @ControllerAdvice :注解定义全局异常处理类
38+
39+ @ExceptionHandler :注解声明异常处理方法
40+
41+ ## 实战
42+
43+ - [ SpringBoot 官网] ( https://spring.io/projects/spring-boot/ )
44+
45+ - [ SpringBoot 实战] ( https://snailclimb.gitee.io/springboot-guide/#/ )
46+
47+ # SpringBoot 面试题
48+
49+ - [ SpringBoot 自动装配原理] ( https://www.cnblogs.com/javaguide/p/springboot-auto-config.html )
50+
51+ - [ Spring Boot面试题(2020最新版)] ( https://thinkwon.blog.csdn.net/article/details/104397299?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-2.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-2.no_search_link )
You can’t perform that action at this time.
0 commit comments