SpringBoot+Thymeleaf的java.lang.ClassNotFoundException: org.thymeleaf.spring5.view.ThymeleafViewR问题解决

        最近使用SpringBoot+MyBatis搭建框架,使用了Thymeleaf模板,但启动的时候报错了,错误及解决方法如下:

错误

Caused by: java.lang.ClassNotFoundException: org.thymeleaf.spring5.view.ThymeleafViewResolver

解决

出现这个错是因为找不到ThymeleafViewResolver,原因是因为我引入了Thymeleaf的版本号,去掉后这个错误就消失了。

SpringBoot+Thymeleaf的java.lang.ClassNotFoundException: org.thymeleaf.spring5.view.ThymeleafViewR问题解决

改正后如下图所示:

SpringBoot+Thymeleaf的java.lang.ClassNotFoundException: org.thymeleaf.spring5.view.ThymeleafViewR问题解决