在使用Springboot开发Maven项目时集成了thymeleaf,集成后报Error resolving template [index], templatesmight not exist的500异常:

Springboot新手开发坑:1.Springboot+thymeleaf报Error resolving template [index], templatesmight not exist的异常

仔细检查项目目录无异常,及pom配置无漏配。

Springboot新手开发坑:1.Springboot+thymeleaf报Error resolving template [index], templatesmight not exist的异常

控制器代码无异常。

Springboot新手开发坑:1.Springboot+thymeleaf报Error resolving template [index], templatesmight not exist的异常

仔细寻找问题,发现在application.properties文件中设置相应的属性有隐藏的空格(prefix后)

Springboot新手开发坑:1.Springboot+thymeleaf报Error resolving template [index], templatesmight not exist的异常

导致路径出错,去掉空格后可正常访问所定义的index.html模板。

Springboot新手开发坑:1.Springboot+thymeleaf报Error resolving template [index], templatesmight not exist的异常

相关文章:

  • 2022-12-23
  • 2021-10-05
  • 2021-04-22
  • 2022-12-23
  • 2021-05-08
  • 2021-12-03
  • 2021-09-14
猜你喜欢
  • 2021-10-23
  • 2021-09-01
  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2021-05-09
  • 2021-12-26
相关资源
相似解决方案