一、异常信息
Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)。
找不到模板位置:classpath:/ templates /(请添加一些模板或检查您的Thymeleaf配置)
二、解决方法
(1)在application.propertoes或yml配置文件中添加
spring.freemarker.checkTemplateLocation=false
或
spring:
freemarker:
checkTemplateLocation: false
(2)在项目的 /src/main/resources/templates 目录下添加一个模板文件.html