I am transferring my project from Thymeleaf 2 to 3, and I am having a problem with the email template recognizer interfering with my website template converter.
When we first introduced Thymeleaf, we followed this document to use email templates and web templates and had no problems (section 4.2):
http://www.thymeleaf.org/doc/articles/springmail.html
During conversion in Thymeleaf 3, I only worked with one resolver template for HTML templates (using SpringResourceTemplateResolver), and the conversion was great. I managed to run the application without any problems, and all view templates are displayed without problems.
However, when you turn on the email template recognizer (using the ClassLoaderTemplateResolver class), the following error occurs when switching to any controller endpoint that returns a view:
java.io.FileNotFoundException: ClassLoader resource "thymeleaf/thymeleaf/login.html" does not exist
Indicates that it is trying to load a template from the ClassLoaderTemplateResolver class, not SpringResourceTemplateResolver. In Thymeleaf 2, setting the Order attribute solved this problem, but this does not seem to work in Thymeleaf 3.
I could not find any help in the Thymeleaf 3 documentation for having 2 template resolvers, as in the Thymeleaf 2 documents.
Any suggestions on how to get this work or documentation I could miss?
source
share