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

 

相关文章:

  • 2021-05-26
  • 2021-09-11
  • 2021-08-20
  • 2021-11-11
  • 2022-12-23
  • 2021-10-19
  • 2021-09-15
猜你喜欢
  • 2022-12-23
  • 2021-08-19
  • 2021-05-11
  • 2022-02-23
  • 2021-08-01
  • 2021-10-04
  • 2021-08-20
相关资源
相似解决方案