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中,名字正确
然后检查你的配置
上面的templates后面有/了这里就不要加/了
还有页面的标签是否都闭合
pom.xml里该导的都导了
网上也有提到检查这个路径的
我以上都没有问题,最后,是在上图的基础上,又添加了
<!--加载模板文件-->
<include>**/*.html</include>
<!--加载静态文件-->
<include>/static/</include>
终于解决,成功访问