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

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>

终于解决,成功访问