Spring Boot HelloWorld
1、开发环境:
jdk:1.8+
idea:2020.2.3
spring boot:2.2.11
2、开始编码
1、点击:File >>> New >>> Project
2、点击:Next
3、修改相关信息,点击:Next
4、选择spring boot对应版本号
5、选择模板引擎Thymeleaf(可以不选或者换一个模板引擎),点击:Next
6、创建HelloWorldController,alt + shift + x 运行项目
7、打开浏览器,访问 localhost:8080,就完成了本期目标,hello world 。
8、再来说说模板引擎Thymeleaf使用,配置相关参数
9、创建hellworld.html
10、HelloWorldController,新增请求地址:helloworld,指定显示页面helloworld.html
11、打开浏览器,访问 localhost:8080/helloworld,就能通过Thymeleaf显示helloworld了。