[Spring Boot Reference Guide] 读书笔记一 Getting Started
8. Introducing Spring Boot
Goals of spring boot:
- Provide a radically faster and widely accessible getting started experience for all Spring development.
- Be opinionated out of the box, but get out of the way quickly as requirements start to diverge from the defaults.
- Provide a range of non-functional features that are common to large classes of projects (e.g. embedded servers, security, metrics, health checks, externalized configuration).
- Absolutely no code generation and no requirement for XML configuration.
9. System Requirements
Spring Boot集成了Tomcat、Jetty等Servlet 3.0+的Web容器。
10. Installing Spring Boot
Spring Boot以及Spring Boot CLI的各种安装方法
11. Developing your first Spring Boot application
1.
The spring-boot-starter-parent is a special starter that provides useful Maven defaults. It also provides a dependency-management section so that you can omit version tags for “blessed” dependencies.
spring-boot-starter-parent提供了所需的依赖,并且可以省略依赖的版本。
spring-boot-starter-web可以用来生成web程序,自带tomcat等。
2. 代码:
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*; @RestController // REST控制器,直接把字符串渲染后返回给调用者
@EnableAutoConfiguration // 自动配置
public class Example {
@RequestMapping("/") // 路由
String home() {
return "Hello World!";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(Example.class, args);
}
}
通过以下命令启动
mvn spring-boot:run
[Spring Boot Reference Guide] 读书笔记一 Getting Started的更多相关文章
- Spring Boot Reference Guide
Spring Boot Reference Guide Authors Phillip Webb, Dave Syer, Josh Long, Stéphane Nicoll, Rob Winch, ...
- 《spring boot 实战》读书笔记
前言:虽然已经用spring boot开发过一套系统,但是之前都是拿来主义,没有系统的,全面的了解过这套框架.现在通过学习<spring boot实战>这本书,希望温故知新.顺便实现自己的 ...
- 第64节:Java中的Spring Boot 2.0简介笔记
Java中的Spring Boot 2.0简介笔记 spring boot简介 依赖java8的运行环境 多模块项目 打包和运行 spring boot是由spring framework构建的,sp ...
- Spring boot 官网学习笔记 - Using Spring Boot without the Parent POM,但是还要使用Parent POM提供的便利
If you do not want to use the spring-boot-starter-parent, you can still keep the benefit of the depe ...
- Spring boot 官网学习笔记 - 开发第一个Spring boot web应用程序(使用mvn执行、使用jar执行)
Creating the POM <?xml version="1.0" encoding="UTF-8"?> <project xmlns= ...
- Spring boot 官网学习笔记 - logging
commons-logging和slf4j是java中的日志门面,即它们提供了一套通用的接口,具体的实现可以由开发者自由选择.log4j和logback则是具体的日志实现方案. 比较常用的搭配是com ...
- Spring boot 官网学习笔记 - Spring Boot 属性配置和使用(转)-application.properties
Spring Boot uses a very particular PropertySource order that is designed to allow sensible overridin ...
- Spring boot 官网学习笔记 - Spring DevTools 介绍
想要使用devtools支持,只需使用dependencies将模块依赖关系添加到你的构建中 运行打包的应用程序时,开发人员工具会自动禁用.如果你通过 java -jar或者其他特殊的类加载器进行启动 ...
- Spring boot 官网学习笔记 - Auto-configuration(@SpringBootApplication、@EnableAutoConfiguration、@Configuration)
Spring Boot auto-configuration attempts to automatically configure your Spring application based on ...
随机推荐
- OC对象:封装、继承、多态的使用举例一
// 该代码在网上找的视频中的例子,感觉很适合类和对象分不清楚的同学参考,仅供学习分享,谢谢 // 创建一个Pointtest类,用属性x.y表示点的坐标位置,求两点之间的距离,使用两种方法:类方法和 ...
- BlockingQueue
BlockingQueue的使用 http://www.cnblogs.com/liuling/p/2013-8-20-01.html BlockingQueue深入分析 http://blog.cs ...
- html验证码
一.原理 1.在webservice服务端,新建一个Bitmap对象,将验证码字符串.干扰线和干扰点绘制到此Bitmap上——>转换为字节数组——>Base64字符串 2.<img ...
- ActionSupport.getText()方法 以及 js中:<s:text name="" />
下面略述com.opensymphony.xwork2.ActionSupport.getText()方法 public String getText(String aTextName) 说明:Get ...
- 检测.net framework 版本
项目中,自己要制作asp.net项目的安装文件,由于项目依赖于.net framework 3.5 sp1,故需检测环境是否符合要求,才能安装程序 度娘找到检测方案:各.net版本对应的安装补录下都有 ...
- Cognitive Radio Emergency Networks – Requirements and Design
2005 IEEE 这是一个典型的Ad hoc场景.紧急情况下的临时自组网络.虽然之前的论文中把它标记为out-of-band global coverage,但这个也是分组的,每个组有个gatewa ...
- 十四、职责链(Chain of Responsibility)模式--行为型模式(Behavioral Pattern)
职责链模式是一种对象的行为模式[GOF95].在责任链模式里,很多对象由每一个对象对其下家的引用而连接起来形成一条链.请求在这个链上传递,直到链上的某一个对象决定处理此请求.发出这个请求的客户端并不知 ...
- 在一个exe文件中查找指定内容,找到则返回起始位置, 否则返回0
//在一个exe文件中查找指定内容,找到则返回起始位置, 否则返回0//如果某字符串, 直接传入字符串进来//如果要查找16进制,则用如下格式传参进来: #$1A#$2A#$3A function F ...
- tr 替换删除字符
1.关于tr 通过使用 tr,您可以非常容易地实现 sed 的许多最基本功能.您可以将 tr 看作为 sed 的(极其)简化的变体:它可以用一个字符来替换另一个字符,或者可以完全除去一些字符.您 ...
- bzoj1633 [Usaco2007 Feb]The Cow Lexicon 牛的词典
Description 没有几个人知道,奶牛有她们自己的字典,里面的有W (1 ≤ W ≤ 600)个词,每个词的长度不超过25,且由小写字母组成.她们在交流时,由于各种原因,用词总是不那么准确.比如 ...