第 1-4 课:写一个 Hello World 来感受 Spring Boot

在学习新技术的时候我们都喜欢先写一个 Hello World 程序,一方面可以验证基础环境的搭建是否正确;另一方面可以快速了解整个开发流程。本节课我们就来学习 Spring Boot 的第一个 Hello World 程序。

什么是 Spring Boot

Spring 在官方首页是这样介绍的:

BUILD ANYTHING.Spring Boot is designed to get you up and running as quickly as possible,with minimal upfront configuration of Spring.Spring Boot takes an opinionated view of building production ready applications.

中文翻译:Spring Boot 可以构建一切。Spring Boot 设计之初就是为了用最少的配置,以最快的速度来启动和运行 Spring 项目。Spring Boot 使用特定的配置来构建生产就绪型的项目。

来一个 Hello World

(1)可以在 Spring Initializr 上面添加,也可以手动在 pom.xml 中添加如下代码

<dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
</dependency>

pom.xml 文件中默认有个模块:

<dependency>
  <groupId>org.springframe

猜你喜欢

转载自blog.csdn.net/ityouknow/article/details/108729174