Spring boot 直接访问templates中html文件

application.properties

Spring boot 直接访问templates中html文件

在浏览器中输入http://localhost:8080/index.html 会报一个

Spring boot 直接访问templates中html文件

 

因为Spring boot 无法直接访问templates下的文件,

想要直接输入http://localhost:8080/index.html显示页面, 需要在src/main/下新建一个package

将html文件放在里面, 然后就可以直接访问了

 

相关文章:

  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
  • 2021-05-06
  • 2022-01-02
  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-14
  • 2021-09-18
相关资源
相似解决方案