没有合适的资源?快使用搜索试试~ 我知道了~
首页springboot 英文文档
springboot 英文文档
需积分: 31 28 下载量 161 浏览量
更新于2023-03-16
评论 3
收藏 2MB PDF 举报
Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run". We take an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss. Most Spring Boot applications need very little Spring configuration.
资源详情
资源评论
资源推荐
Spring Boot Reference Guide
1.5.18.RELEASE
Phillip Webb , Dave Syer , Josh Long , Stéphane Nicoll , Rob Winch , Andy
Wilkinson , Marcel Overdijk , Christian Dupuis , Sébastien Deleuze , Michael Simons
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
1.5.18.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 ........................................................................... 14
Manual installation ............................................................................................ 14
Installation with SDKMAN! ................................................................................. 14
OSX Homebrew installation ............................................................................... 15
MacPorts installation ......................................................................................... 15
Command-line completion ................................................................................. 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 ............................................................................... 24
Using Spring Boot without the parent POM ........................................................ 25
Changing the Java version ................................................................................ 26
Using the Spring Boot Maven plugin .................................................................. 26
13.3. Gradle .............................................................................................................. 26
13.4. Ant ................................................................................................................... 27
13.5. Starters ............................................................................................................ 28
14. Structuring your code .................................................................................................. 33
14.1. Using the “default” package .............................................................................. 33
Spring Boot Reference Guide
1.5.18.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 .................................................................. 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
Excluding resources .......................................................................................... 44
Watching additional paths .................................................................................. 44
Disabling restart ................................................................................................ 44
Using a trigger file ............................................................................................ 44
Customizing the restart classloader .................................................................... 45
Known limitations .............................................................................................. 45
20.3. LiveReload ....................................................................................................... 46
20.4. Global settings ................................................................................................. 46
20.5. Remote applications ......................................................................................... 46
Running the remote client application ................................................................. 47
Remote update ................................................................................................. 48
Remote debug tunnel ........................................................................................ 48
21. Packaging your application for production ..................................................................... 50
22. What to read next ....................................................................................................... 51
IV. Spring Boot features ............................................................................................................ 52
23. SpringApplication ......................................................................................................... 53
23.1. Startup failure ................................................................................................... 53
23.2. Customizing the Banner .................................................................................... 54
23.3. Customizing SpringApplication .......................................................................... 55
23.4. Fluent builder API ............................................................................................. 55
23.5. Application events and listeners ........................................................................ 56
23.6. Web environment ............................................................................................. 57
23.7. Accessing application arguments ....................................................................... 57
23.8. Using the ApplicationRunner or CommandLineRunner ........................................ 57
23.9. Application exit ................................................................................................. 58
23.10. Admin features ............................................................................................... 58
24. Externalized Configuration ........................................................................................... 60
24.1. Configuring random values ............................................................................... 61
24.2. Accessing command line properties .................................................................. 61
24.3. Application property files ................................................................................... 62
24.4. Profile-specific properties .................................................................................. 63
24.5. Placeholders in properties ................................................................................. 64
Spring Boot Reference Guide
1.5.18.RELEASE Spring Boot iv
24.6. Using YAML instead of Properties ..................................................................... 64
Loading YAML .................................................................................................. 64
Exposing YAML as properties in the Spring Environment .................................... 65
Multi-profile YAML documents ........................................................................... 65
YAML shortcomings .......................................................................................... 66
Merging YAML lists ........................................................................................... 66
24.7. Type-safe Configuration Properties .................................................................... 67
Third-party configuration .................................................................................... 70
Relaxed binding ................................................................................................ 70
Properties conversion ........................................................................................ 71
@ConfigurationProperties Validation .................................................................. 71
@ConfigurationProperties vs. @Value ............................................................... 72
25. Profiles ....................................................................................................................... 73
25.1. Adding active profiles ....................................................................................... 73
25.2. Programmatically setting profiles ....................................................................... 73
25.3. Profile-specific configuration files ....................................................................... 74
26. Logging ....................................................................................................................... 75
26.1. Log format ....................................................................................................... 75
26.2. Console output ................................................................................................. 75
Color-coded output ............................................................................................ 76
26.3. File output ........................................................................................................ 77
26.4. Log Levels ....................................................................................................... 77
26.5. Custom log configuration .................................................................................. 78
26.6. Logback extensions .......................................................................................... 79
Profile-specific configuration .............................................................................. 80
Environment properties ...................................................................................... 80
27. Developing web applications ........................................................................................ 81
27.1. The ‘Spring Web MVC framework’ .................................................................... 81
Spring MVC auto-configuration .......................................................................... 81
HttpMessageConverters .................................................................................... 82
Custom JSON Serializers and Deserializers ....................................................... 82
MessageCodesResolver .................................................................................... 83
Static Content ................................................................................................... 83
Custom Favicon ................................................................................................ 85
ConfigurableWebBindingInitializer ...................................................................... 85
Template engines .............................................................................................. 85
Error Handling .................................................................................................. 85
Custom error pages .................................................................................. 86
Mapping error pages outside of Spring MVC .............................................. 87
Error Handling on WebSphere Application Server ....................................... 87
Spring HATEOAS .............................................................................................. 88
CORS support .................................................................................................. 88
27.2. JAX-RS and Jersey .......................................................................................... 88
27.3. Embedded servlet container support .................................................................. 89
Servlets, Filters, and listeners ............................................................................ 90
Registering Servlets, Filters, and listeners as Spring beans ......................... 90
Servlet Context Initialization ............................................................................... 90
Scanning for Servlets, Filters, and listeners ................................................ 90
The EmbeddedWebApplicationContext ............................................................... 90
Customizing embedded servlet containers .......................................................... 91
Spring Boot Reference Guide
1.5.18.RELEASE Spring Boot v
Programmatic customization ...................................................................... 91
Customizing ConfigurableEmbeddedServletContainer directly ...................... 92
JSP limitations .................................................................................................. 92
28. Security ...................................................................................................................... 93
28.1. OAuth2 ............................................................................................................ 94
Authorization Server .......................................................................................... 94
Resource Server ............................................................................................... 94
28.2. Token Type in User Info ................................................................................... 95
28.3. Customizing the User Info RestTemplate ........................................................... 95
Client ................................................................................................................ 96
Single Sign On ................................................................................................. 97
28.4. Actuator Security .............................................................................................. 98
29. Working with SQL databases ....................................................................................... 99
29.1. Configure a DataSource ................................................................................... 99
Embedded Database Support ............................................................................ 99
Connection to a production database ............................................................... 100
Connection to a JNDI DataSource ................................................................... 101
29.2. Using JdbcTemplate ....................................................................................... 101
29.3. JPA and ‘Spring Data’ .................................................................................... 102
Entity Classes ................................................................................................. 102
Spring Data JPA Repositories .......................................................................... 103
Creating and dropping JPA databases ............................................................. 104
Open EntityManager in View ........................................................................... 104
29.4. Using H2’s web console ................................................................................. 104
Changing the H2 console’s path ...................................................................... 104
Securing the H2 console ................................................................................. 105
29.5. Using jOOQ ................................................................................................... 105
Code Generation ............................................................................................. 105
Using DSLContext ........................................................................................... 105
Customizing jOOQ .......................................................................................... 106
30. Working with NoSQL technologies ............................................................................. 107
30.1. Redis ............................................................................................................. 107
Connecting to Redis ........................................................................................ 107
30.2. MongoDB ....................................................................................................... 107
Connecting to a MongoDB database ................................................................ 107
MongoTemplate .............................................................................................. 108
Spring Data MongoDB repositories .................................................................. 109
Embedded Mongo ........................................................................................... 109
30.3. Neo4j ............................................................................................................. 110
Connecting to a Neo4j database ...................................................................... 110
Using the embedded mode .............................................................................. 110
Neo4jSession .................................................................................................. 111
Spring Data Neo4j repositories ........................................................................ 111
Repository example ......................................................................................... 111
30.4. Gemfire .......................................................................................................... 111
30.5. Solr ................................................................................................................ 112
Connecting to Solr .......................................................................................... 112
Spring Data Solr repositories ........................................................................... 112
30.6. Elasticsearch .................................................................................................. 112
Connecting to Elasticsearch using Jest ............................................................ 112
剩余385页未读,继续阅读
xiangagou
- 粉丝: 2
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- RTL8188FU-Linux-v5.7.4.2-36687.20200602.tar(20765).gz
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0