【发布时间】:2018-11-06 09:16:45
【问题描述】:
我将 Springboot 1.5.7 用于我的 rest api 应用程序,并且我正在使用 thymeleaf 模板从我的 api 发送电子邮件。但是,当我将 Spring Boot 的版本更新到 2.0.2 时,它会抛出 404 错误,即“错误解析模板“错误”,模板可能不存在或可能无法被任何配置的模板解析器访问”。
下面是我在 application.yml 中的配置
spring:
thymeleaf:
cache: false
enabled: true
mode: HTML5
prefix: /templates/
suffix: .html
pom.xml 中的百里香叶版本
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<version>2.0.2.RELEASE</version>
</dependency>
下面是我使用的模板结构,
我的应用程序发布非常接近,我严重卡住了这个问题,如果有人可以为我提供解决方法,那将是一个很大的帮助。
【问题讨论】:
-
您的问题解决了吗?如果解决了,您应该接受答案。
标签: spring spring-boot thymeleaf