Cannot find template location(s): [classpath:/templates/]

简介: 版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢。 https://blog.csdn.net/testcs_dn/article/details/80914838 ...
版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢。 https://blog.csdn.net/testcs_dn/article/details/80914838

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





目录
相关文章
解决FatalThrowableError in EloquentUserProvider.php line 126: Class '\App\User'问题
解决方法:http://stackoverflow.com/questions/28516454/laravel-5-user-model-not-found 总结:是因为我把app下的User移动到app\Models下了,所以You need to update your config/auth.
1131 0
|
JavaScript 前端开发
成功解决Component template should contain exactly one root element
成功解决Component template should contain exactly one root element
|
关系型数据库 Java Shell
find-a-jar-file-given-the-class-name
Save this as findclass.sh (or whatever), put it on your path and make it executable: #!/bin/sh find "$1" -name "*.
789 0
|
PHP
【PHP】Cannot declare class app\admin\controller\Goods because the name is already in use
【PHP】Cannot declare class app\admin\controller\Goods because the name is already in use
270 0
【PHP】Cannot declare class app\admin\controller\Goods because the name is already in use
|
9月前
An error happened during template parsing (template: “ServletContext resource [/WEB-INF/templates/in
An error happened during template parsing (template: “ServletContext resource [/WEB-INF/templates/in
error: Two output files share the same path but have different contents: node_modules\.vite\..xxx.js
error: Two output files share the same path but have different contents: node_modules\.vite\..xxx.js
794 0
error: Two output files share the same path but have different contents: node_modules\.vite\..xxx.js

热门文章

最新文章