解决
[THYMELEAF][org.springframework.amqp.rabbit.RabbitListenerEndpointContainer#0-1] Exception processing template “xxxx.html”: Error resolving template [register.html], template might not exist or might not be accessible by any of the configured Template Resolvers
org.thymeleaf.exceptions.TemplateInputException: Error resolving template [xxxx.html], template might not exist or might not be accessible by any of the configured Template Resolvers
项目中使用到了邮件发送功能,需要使用thymeleaf的模板进行邮件发送,但是发现模板一直找不到,
最后发现Target文件中不包含模板引擎文件:
解决方案:
pom.xml文件中对html文件放行
:这个元素用于指定要包含在构建中的资源文件的通配符模式列表。在这个配置中,它包括了以下不同类型的资源文件:
**/.html:所有HTML文件
**/.properties:所有属性文件(通常是应用程序的配置文件)
**/.yml:所有YAML文件(另一种配置文件格式)
**/.xml:所有XML文件
**/*.tld:所有标签库描述文件
false:这个元素指定了是否对这些资源文件进行过滤。在这个配置中,设置为false表示不会对这些文件进行过滤,即它们将按原样包含在生成的JAR文件中。
这个配置的目的是告诉Maven,在构建项目时,将src/main/resources目录下满足上述通配符模式的各种资源文件包含在生成的JAR文件中。
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.html</include>
<include>**/*.properties</include>
<include>**/*.yml</include>
<include>**/*.xml</include>
<include>**/*.tld</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>