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 格式的。

添加配置:

application.properties

spring.freemarker.checkTemplateLocation=false

yml

       spring: 
           freemarker:
               checkTemplateLocation: false 

 

 

 

Logo

一站式虚拟内容创作平台,激发创意,赋能创作,进入R空间,遇见同道,让优质作品闪耀发光。​

更多推荐