Spring-boot thymeleaf 从 classpath 加载 HTML 文件
2022-09-03 06:57:09
我有一个多模块项目结构,如:
- application (parent module)
--- boot (web-app)
----- src/main/resources/templates/layout.html
---- todo (jar file)
----- src/main/resources/templates/home.html
和我的控制器上:
@RequestMapping(value = "/home")
public String home() {
return "todo/home";
}
我收到错误消息,如下所示:
Error resolving template "todo/home", template might not exist or
might not be accessible by any of the configured Template
Resolvers]
是否需要配置来配置专门针对spring的配置,以便在类路径上搜索模板?