spring boot 启动FreeMarkerAutoConfiguration错误

时间:2025-03-20 09:38:14

自己搭建spring boot 项目时,运行报错 内容为 Error creating bean with name '': 原因是 : Cannot find template location(s): [classpath:/templates/] (please add some templates, check your FreeMarker configuration, or set =false) 

经过网上查询,出现这个错误的原因spring boot 默认搜索项目templates文件,而自己没有创建该文件。如果不想创建该目录可以在启动项配置文件中添加如下配置:


=false