没有合适的资源?快使用搜索试试~ 我知道了~
SpringBoot2.1官方文档 完整版

温馨提示
SpringBoot2.1官方文档 十分详细
资源推荐
资源详情
资源评论














Spring Boot Reference Guide
2.1.0.RELEASE
Phillip Webb , Dave Syer , Josh Long , Stéphane Nicoll , Rob Winch , Andy Wilkinson , Marcel Overdijk ,
Christian Dupuis , Sébastien Deleuze , Michael Simons , Vedran Pavi# , Jay Bryant , Madhura Bhave
Copyright © 2012-2018
Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee
for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.

Spring Boot Reference Guide
2.1.0.RELEASE Spring Boot ii
Table of Contents
I. Spring Boot Documentation ...................................................................................................... 1
1. About the Documentation ................................................................................................ 2
2. Getting Help ................................................................................................................... 3
3. First Steps ...................................................................................................................... 4
4. Working with Spring Boot ................................................................................................ 5
5. Learning about Spring Boot Features .............................................................................. 6
6. Moving to Production ...................................................................................................... 7
7. Advanced Topics ............................................................................................................ 8
II. Getting Started ....................................................................................................................... 9
8. Introducing Spring Boot ................................................................................................. 10
9. System Requirements ................................................................................................... 11
9.1. Servlet Containers .............................................................................................. 11
10. Installing Spring Boot .................................................................................................. 12
10.1. Installation Instructions for the Java Developer .................................................. 12
Maven Installation ............................................................................................. 12
Gradle Installation ............................................................................................. 13
10.2. Installing the Spring Boot CLI ........................................................................... 13
Manual Installation ............................................................................................ 13
Installation with SDKMAN! ................................................................................. 14
OSX Homebrew Installation ............................................................................... 14
MacPorts Installation ......................................................................................... 15
Command-line Completion ................................................................................ 15
Windows Scoop Installation ............................................................................... 15
Quick-start Spring CLI Example ......................................................................... 15
10.3. Upgrading from an Earlier Version of Spring Boot .............................................. 16
11. Developing Your First Spring Boot Application .............................................................. 17
11.1. Creating the POM ............................................................................................ 17
11.2. Adding Classpath Dependencies ....................................................................... 18
11.3. Writing the Code .............................................................................................. 18
The @RestController and @RequestMapping Annotations .................................. 19
The @EnableAutoConfiguration Annotation ........................................................ 19
The “main” Method ........................................................................................... 19
11.4. Running the Example ....................................................................................... 19
11.5. Creating an Executable Jar ............................................................................... 20
12. What to Read Next ..................................................................................................... 22
III. Using Spring Boot ................................................................................................................ 23
13. Build Systems ............................................................................................................. 24
13.1. Dependency Management ................................................................................ 24
13.2. Maven ............................................................................................................. 24
Inheriting the Starter Parent .............................................................................. 25
Using Spring Boot without the Parent POM ........................................................ 25
Using the Spring Boot Maven Plugin ................................................................. 26
13.3. Gradle ............................................................................................................. 26
13.4. Ant .................................................................................................................. 26
13.5. Starters ............................................................................................................ 27
14. Structuring Your Code ................................................................................................. 33
14.1. Using the “default” Package .............................................................................. 33

Spring Boot Reference Guide
2.1.0.RELEASE Spring Boot iii
14.2. Locating the Main Application Class .................................................................. 33
15. Configuration Classes ................................................................................................. 35
15.1. Importing Additional Configuration Classes ........................................................ 35
15.2. Importing XML Configuration ............................................................................. 35
16. Auto-configuration ....................................................................................................... 36
16.1. Gradually Replacing Auto-configuration ............................................................. 36
16.2. Disabling Specific Auto-configuration Classes .................................................... 36
17. Spring Beans and Dependency Injection ...................................................................... 37
18. Using the @SpringBootApplication Annotation .............................................................. 38
19. Running Your Application ............................................................................................ 40
19.1. Running from an IDE ....................................................................................... 40
19.2. Running as a Packaged Application .................................................................. 40
19.3. Using the Maven Plugin ................................................................................... 40
19.4. Using the Gradle Plugin ................................................................................... 41
19.5. Hot Swapping .................................................................................................. 41
20. Developer Tools .......................................................................................................... 42
20.1. Property Defaults ............................................................................................. 42
20.2. Automatic Restart ............................................................................................. 43
Logging changes in condition evaluation ............................................................ 44
Excluding Resources ......................................................................................... 44
Watching Additional Paths ................................................................................. 45
Disabling Restart .............................................................................................. 45
Using a Trigger File .......................................................................................... 45
Customizing the Restart Classloader ................................................................. 45
Known Limitations ............................................................................................. 46
20.3. LiveReload ....................................................................................................... 46
20.4. Global Settings ................................................................................................. 46
20.5. Remote Applications ......................................................................................... 47
Running the Remote Client Application .............................................................. 47
Remote Update ................................................................................................ 48
21. Packaging Your Application for Production ................................................................... 49
22. What to Read Next ..................................................................................................... 50
IV. Spring Boot features ............................................................................................................ 51
23. SpringApplication ........................................................................................................ 52
23.1. Startup Failure ................................................................................................. 52
23.2. Customizing the Banner ................................................................................... 53
23.3. Customizing SpringApplication .......................................................................... 54
23.4. Fluent Builder API ............................................................................................ 54
23.5. Application Events and Listeners ...................................................................... 55
23.6. Web Environment ............................................................................................. 56
23.7. Accessing Application Arguments ...................................................................... 56
23.8. Using the ApplicationRunner or CommandLineRunner ....................................... 57
23.9. Application Exit ................................................................................................ 57
23.10. Admin Features .............................................................................................. 58
24. Externalized Configuration ........................................................................................... 59
24.1. Configuring Random Values ............................................................................. 60
24.2. Accessing Command Line Properties ................................................................ 60
24.3. Application Property Files ................................................................................. 61
24.4. Profile-specific Properties ................................................................................. 62
24.5. Placeholders in Properties ................................................................................ 63

Spring Boot Reference Guide
2.1.0.RELEASE Spring Boot iv
24.6. Encrypting Properties ....................................................................................... 63
24.7. Using YAML Instead of Properties .................................................................... 63
Loading YAML .................................................................................................. 64
Exposing YAML as Properties in the Spring Environment .................................... 64
Multi-profile YAML Documents ........................................................................... 64
YAML Shortcomings ......................................................................................... 65
24.8. Type-safe Configuration Properties ................................................................... 66
Third-party Configuration ................................................................................... 69
Relaxed Binding ................................................................................................ 69
Merging Complex Types ................................................................................... 70
Properties Conversion ....................................................................................... 72
Converting durations ................................................................................. 72
Converting Data Sizes .............................................................................. 73
@ConfigurationProperties Validation .................................................................. 74
@ConfigurationProperties vs. @Value ............................................................... 75
25. Profiles ....................................................................................................................... 77
25.1. Adding Active Profiles ...................................................................................... 77
25.2. Programmatically Setting Profiles ...................................................................... 78
25.3. Profile-specific Configuration Files ..................................................................... 78
26. Logging ...................................................................................................................... 79
26.1. Log Format ...................................................................................................... 79
26.2. Console Output ................................................................................................ 79
Color-coded Output ........................................................................................... 80
26.3. File Output ....................................................................................................... 81
26.4. Log Levels ....................................................................................................... 81
26.5. Log Groups ...................................................................................................... 82
26.6. Custom Log Configuration ................................................................................ 82
26.7. Logback Extensions ......................................................................................... 84
Profile-specific Configuration ............................................................................. 85
Environment Properties ..................................................................................... 85
27. JSON ......................................................................................................................... 86
27.1. Jackson ........................................................................................................... 86
27.2. Gson ............................................................................................................... 86
27.3. JSON-B ........................................................................................................... 86
28. Developing Web Applications ...................................................................................... 87
28.1. The “Spring Web MVC Framework” .................................................................. 87
Spring MVC Auto-configuration .......................................................................... 87
HttpMessageConverters .................................................................................... 88
Custom JSON Serializers and Deserializers ....................................................... 88
MessageCodesResolver .................................................................................... 89
Static Content ................................................................................................... 89
Welcome Page ................................................................................................. 91
Custom Favicon ................................................................................................ 91
Path Matching and Content Negotiation ............................................................. 91
ConfigurableWebBindingInitializer ...................................................................... 91
Template Engines ............................................................................................. 92
Error Handling .................................................................................................. 92
Custom Error Pages ................................................................................. 93
Mapping Error Pages outside of Spring MVC ............................................. 94
Spring HATEOAS ............................................................................................. 94

Spring Boot Reference Guide
2.1.0.RELEASE Spring Boot v
CORS Support .................................................................................................. 95
28.2. The “Spring WebFlux Framework” ..................................................................... 95
Spring WebFlux Auto-configuration .................................................................... 96
HTTP Codecs with HttpMessageReaders and HttpMessageWriters ..................... 97
Static Content ................................................................................................... 97
Template Engines ............................................................................................. 98
Error Handling .................................................................................................. 98
Custom Error Pages ................................................................................. 99
Web Filters ....................................................................................................... 99
28.3. JAX-RS and Jersey .......................................................................................... 99
28.4. Embedded Servlet Container Support .............................................................. 100
Servlets, Filters, and listeners .......................................................................... 101
Registering Servlets, Filters, and Listeners as Spring Beans ...................... 101
Servlet Context Initialization ............................................................................. 101
Scanning for Servlets, Filters, and listeners .............................................. 102
The ServletWebServerApplicationContext ......................................................... 102
Customizing Embedded Servlet Containers ...................................................... 102
Programmatic Customization ................................................................... 103
Customizing ConfigurableServletWebServerFactory Directly ...................... 103
JSP Limitations ............................................................................................... 104
28.5. Embedded Reactive Server Support ................................................................ 104
28.6. Reactive Server Resources Configuration ........................................................ 104
29. Security .................................................................................................................... 105
29.1. MVC Security ................................................................................................. 105
29.2. WebFlux Security ........................................................................................... 106
29.3. OAuth2 .......................................................................................................... 106
Client .............................................................................................................. 106
OAuth2 client registration for common providers ....................................... 107
Resource Server ............................................................................................. 108
Authorization Server ........................................................................................ 108
29.4. Actuator Security ............................................................................................ 108
Cross Site Request Forgery Protection ............................................................ 108
30. Working with SQL Databases .................................................................................... 110
30.1. Configure a DataSource ................................................................................. 110
Embedded Database Support .......................................................................... 110
Connection to a Production Database .............................................................. 111
Connection to a JNDI DataSource ................................................................... 112
30.2. Using JdbcTemplate ....................................................................................... 112
30.3. JPA and Spring Data JPA .............................................................................. 113
Entity Classes ................................................................................................. 113
Spring Data JPA Repositories ......................................................................... 114
Creating and Dropping JPA Databases ............................................................ 115
Open EntityManager in View ........................................................................... 115
30.4. Spring Data JDBC .......................................................................................... 115
30.5. Using H2’s Web Console ................................................................................ 116
Changing the H2 Console’s Path ..................................................................... 116
30.6. Using jOOQ ................................................................................................... 116
Code Generation ............................................................................................. 116
Using DSLContext ........................................................................................... 117
jOOQ SQL Dialect .......................................................................................... 117
剩余440页未读,继续阅读
资源评论

- 小瑞2020-11-13全英文啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊

001001了凡
- 粉丝: 2
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- b2b网站策划书(1).docx
- 2023年卫生招聘考试之卫生招聘(计算机信息管理)押题练习试卷B卷附答案(1).docx
- 载波通信基本原理知识-PPT(1).ppt
- 会计流程再造在企业财务信息化中的应用解析(1).doc
- 魏燕庆论电子商务企业与知识管理(1).doc
- 山东师范大学C语言程序设计期末试题含答案(1).pdf
- 农村金融信息化建设研究(1).doc
- JC-3166软件使用手册可编辑范本(1).doc
- 2023年大数据管理中心设计规划方案(1).ppt
- 2025年航天器结构系统项目大数据研究报告(1).docx
- 卫星通信第四章(1).pdf
- 软件培训(1).ppt
- 2025年轨道交通项目大数据研究报告(1).docx
- 分销管理与电子商务项目解决方案项目实施建议书 (1)(1).doc
- 人工智能法律顾问服务协议(范本)(1).docx
- 工艺工法QC用CAD制图技术进行弧形结构放样施工工法(1).doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
