Spring Boot HelloWorld

1、开发环境:

jdk:1.8+

idea:2020.2.3

spring boot:2.2.11

 

2、开始编码

1、点击:File >>> New >>> Project

spring boot helloworld

2、点击:Next

spring boot helloworld

3、修改相关信息,点击:Next

spring boot helloworld

4、选择spring boot对应版本号

spring boot helloworld

5、选择模板引擎Thymeleaf(可以不选或者换一个模板引擎),点击:Next

spring boot helloworld

6、创建HelloWorldController,alt + shift + x 运行项目

spring boot helloworld

7、打开浏览器,访问 localhost:8080,就完成了本期目标,hello world 。

spring boot helloworld

8、再来说说模板引擎Thymeleaf使用,配置相关参数

spring boot helloworld

9、创建hellworld.html

spring boot helloworld

10、HelloWorldController,新增请求地址:helloworld,指定显示页面helloworld.html

spring boot helloworld

11、打开浏览器,访问 localhost:8080/helloworld,就能通过Thymeleaf显示helloworld了。

spring boot helloworld

 

相关文章: