SpringBoot 项目启动后,可能在控制台看到这样一个警告:

WARN 8904 --- [  restartedMain] o.s.b.a.f.FreeMarkerAutoConfiguration 

Cannot find template location(s): [classpath:/templates/] (please add some templates, check your FreeMarker configuration, or set spring.freemarker.checkTemplateLocation=false)


其实你可以忽略不必管它。

但你如果不想看到它,想知道什么原因的话。

其实这个提示还是比较明确的。

解决方法:

1、在项目的 /src/main/resources/templates 目录下添加一个模板文件,比如 .jsp 或 .ftl 文件。

2、打开项目配置文件 application.properties,有的人可能喜欢使用 .yml 格式的。

添加配置:

spring.freemarker.checkTemplateLocation=false






本文转载:CSDN博客