springboot整合thymeleaf报Error resolving template [xx]的解决办法

报错信息:Error resolving template [hello], template might not exist or might not be accessible by any of the configured Template Resolvers
就是找不到这个模板或者模板不可用
首先确定你的hello.html存在于templates中,名字正确
springboot整合thymeleaf报Error resolving template [xx]的解决办法
然后检查你的配置
springboot整合thymeleaf报Error resolving template [xx]的解决办法
上面的templates后面有/了这里就不要加/了
springboot整合thymeleaf报Error resolving template [xx]的解决办法
还有页面的标签是否都闭合
springboot整合thymeleaf报Error resolving template [xx]的解决办法
pom.xml里该导的都导了
springboot整合thymeleaf报Error resolving template [xx]的解决办法
网上也有提到检查这个路径的
springboot整合thymeleaf报Error resolving template [xx]的解决办法
我以上都没有问题,最后,是在上图的基础上,又添加了

<!--加载模板文件--> 
<include>**/*.html</include> 
<!--加载静态文件--> 
<include>/static/</include>

终于解决,成功访问

相关文章:

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