找不到模板位置:classpath:/templates/

问题描述 投票:0回答:1

我已将 html 文件包含在 Spring Boot 应用程序的 src/main/resources/templates 文件夹下。然而,我在本地主机中收到 Whitelabel 错误,并在控制台中收到“找不到模板位置:classpath:/templates/(请添加一些模板或检查您的 Thymeleaf 配置)”。有人可以帮忙吗?

我什至无法调用单个 html 页面。

spring spring-boot spring-mvc thymeleaf spring-thymeleaf
1个回答
0
投票

运行

maven install
两次(!);然后就可以了。

© www.soinside.com 2019 - 2024. All rights reserved.