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





目录
相关文章
|
1月前
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
|
SQL 算法
【hacker的错误集】html5lib使用报错Couldn‘t find a tree builder with the features you requested: html5lib
分析得出:bs4的特征没有找到:找不到具有您请求功能的树生成器:html5lib。您需要安装解析器库吗?
331 0
【hacker的错误集】html5lib使用报错Couldn‘t find a tree builder with the features you requested: html5lib
|
9月前
|
JavaScript 前端开发
成功解决Component template should contain exactly one root element
成功解决Component template should contain exactly one root element
|
11月前
报错 An error happened during template parsing (template: “ServletContext resource [/shiroTest.html]“)
报错 An error happened during template parsing (template: “ServletContext resource [/shiroTest.html]“)
|
PHP
PHP: Laravel报错Target class [App\\service\\AuthService] does not exist
PHP: Laravel报错Target class [App\\service\\AuthService] does not exist
97 0
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
558 0
error: Two output files share the same path but have different contents: node_modules\.vite\..xxx.js
Note that ‘/home/w/.local/share‘ is not in the search pathset by the XDG_DATA_HOME and XDG_DATA_DIRS
Note that ‘/home/w/.local/share‘ is not in the search pathset by the XDG_DATA_HOME and XDG_DATA_DIRS
267 0
|
移动开发 监控 安全
HTML访问本地路径报错 Not allowed to load local resource
HTML访问本地路径报错 Not allowed to load local resource
HTML访问本地路径报错 Not allowed to load local resource
Target class [Admin\LoginController] does not exist.
Laravel 8配置好路由后,访问提示:Target class [XXXXXController] does not exist.错误。出现这个错误的原因是Laravel8对路由命名空间做出了更新(详见:路由命名空间更新),而我们仍然在使用Laravel6或者7版本的方式写路由。 Laravel 8路由配置方式: use App\Http\Controllers\LoginController; Route::get('login', [LoginController::class, 'index']);
|
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
215 0
【PHP】Cannot declare class app\admin\controller\Goods because the name is already in use