template might not exist or might not be accessible by any of the configured Template Resolvers

1、springboot +mybatis整合时,访问页面报错如下:

2020-10-14 14:35:20.551 ERROR 8668 --- [nio-8080-exec-1] org.thymeleaf.TemplateEngine             : [THYMELEAF][http-nio-8080-exec-1] Exception processing template "addUser.html": Error resolving template [addUser.html], template might not exist or might not be accessible by any of the configured Template Resolvers

2、在网上找了大半天资料也没有找到,后来反复测试,发现在POM.xml配置文件中加了如下配置信息:

<resource>
   <directory>src/main/resources</directory>
   <includes>
      <include>**/*.yml</include>
      <include>**/*.properties</include>
   </includes>
</resource>

3、后来把这个resource配置信息去掉后,访问页面就不报错了,但后续整合mybatis时,访问addUser方法时报错

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.cw.mapper.UserMapper.insert

4、最后没办法,又把resource配置信息添加上,反复测试后,添加了配置信息<include>**/*.html</include>,就没有如上报错信息,具体原因没查,如果需要的话,自查吧,希望这个能帮助你。

<resource>
   <directory>src/main/resources</directory>
   <includes>
      <include>**/*.yml</include>
      <include>**/*.html</include>
      <include>**/*.properties</include>
   </includes>
</resource>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值