您当前的位置: 首页 >  eureka

qq_34412985

暂无认证

  • 2浏览

    0关注

    1061博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

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

qq_34412985 发布时间:2020-03-27 20:57:58 ,浏览量:2

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)

关注
打赏
1653291990
查看更多评论
立即登录/注册

微信扫码登录

0.0402s