项目场景:
springboot 整合thymeleaf
问题描述:
项目启动后无法访问Controller跳转的html
Template might not exist or might not be accessible
原因分析:
翻译过来其实就是无法找到跳转的html页面。
解决方案:
首先我推荐大家看这位大佬的解决方案,https://blog.csdn.net/liming_0820/article/details/80878168
如果不行的话,在看我的解决方案:首先看项目启动时是否有这句话:[THYMELEAF][main] Template Mode 'HTML5' is deprecated. Using Template Mode 'HTML' instead.如果有的话,很明显,在springboot的配置文件中(application.properties or application.yml),找到这个配置项:spring.thymeleaf.mode=HTML5,将其改为:spring.thymeleaf.mode=HTML,个人感觉是springboot版本不同,导致这个配置项的写法不同,本人用的是springboot 2.3.3版本。