springboot启eureka时:Cannot find template location(s): [classpath:/templates/]

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 文件。(此方法有用,我加的empty.ftl)

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

添加配置:

spring.freemarker.checkTemplateLocation=false(这个没起作用,springboot是2.1.9版本,springcloud是Greenwich.SR3)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值