You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...
Caused by: org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "ServletContext resource [/WEB-INF/thymeleaf/templates/email/welcome.html]")
at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:241)
at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone(AbstractMarkupTemplateParser.java:100)
at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:666)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1103)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1064)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1053)
at com.sihuve.dyskover.common.manager.template.TemplateManager.render(TemplateManager.java:227)
... 181 more
Caused by: org.attoparser.ParseException: Error resolving template [email/fragments/header.html], template might not exist or might not be accessible by any of the configured Template Resolvers (template: "/email/welcome.html" - line 8, col 6)
at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:393)
at org.attoparser.MarkupParser.parse(MarkupParser.java:257)
at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:230)
... 187 more
Caused by: org.thymeleaf.exceptions.TemplateInputException: Error resolving template [email/fragments/header.html], template might not exist or might not be accessible by any of the configured Template Resolvers (template: "/email/welcome.html" - line 8, col 6)
at org.thymeleaf.engine.TemplateManager.resolveTemplate(TemplateManager.java:869)
at org.thymeleaf.engine.TemplateManager.parseStandalone(TemplateManager.java:250)
at org.thymeleaf.standard.expression.FragmentExpression.resolveExecutedFragmentExpression(FragmentExpression.java:567)
at org.thymeleaf.standard.processor.AbstractStandardFragmentInsertionTagProcessor.computeFragment(AbstractStandardFragmentInsertionTagProcessor.java:419)
at org.thymeleaf.standard.processor.AbstractStandardFragmentInsertionTagProcessor.doProcess(AbstractStandardFragmentInsertionTagProcessor.java:115)
at org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess(AbstractAttributeTagProcessor.java:74)
at org.thymeleaf.processor.element.AbstractElementTagProcessor.process(AbstractElementTagProcessor.java:95)
at org.thymeleaf.util.ProcessorConfigurationUtils$ElementTagProcessorWrapper.process(ProcessorConfigurationUtils.java:633)
at org.thymeleaf.engine.ProcessorTemplateHandler.handleOpenElement(ProcessorTemplateHandler.java:1314)
at org.thymeleaf.engine.TemplateHandlerAdapterMarkupHandler.handleOpenElementEnd(TemplateHandlerAdapterMarkupHandler.java:304)
at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler$InlineMarkupAdapterPreProcessorHandler.handleOpenElementEnd(InlinedOutputExpressionMarkupHandler.java:278)
at org.thymeleaf.standard.inline.OutputExpressionInlinePreProcessorHandler.handleOpenElementEnd(OutputExpressionInlinePreProcessorHandler.java:186)
at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler.handleOpenElementEnd(InlinedOutputExpressionMarkupHandler.java:124)
at org.attoparser.HtmlElement.handleOpenElementEnd(HtmlElement.java:109)
at org.attoparser.HtmlMarkupHandler.handleOpenElementEnd(HtmlMarkupHandler.java:297)
at org.attoparser.MarkupEventProcessorHandler.handleOpenElementEnd(MarkupEventProcessorHandler.java:402)
at org.attoparser.ParsingElementMarkupUtil.parseOpenElement(ParsingElementMarkupUtil.java:159)
at org.attoparser.MarkupParser.parseBuffer(MarkupParser.java:710)
at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:301)
doesn't matter which fragment path you use:
email/fragments/header.html
email/fragments/header
fragments/header.html
fragments/header
The text was updated successfully, but these errors were encountered:
Hey there, the thymeleaf-spring6 package was moved into the main thymeleaf repo a while back, so there probably aren't too many people monitoring this repo.
As for your issue, "Error resolving template" is in many cases a path issue. I can see from your config that you have a path prefix of /WEB-INF/thymeleaf/templates, and you're trying to find a template fragment at email/fragments/header.html, so when you put those 2 together you get /WEB-INF/thymeleaf/templatesemail/fragments/header.html which is missing a / in the middle to complete it.
Given you're doing things like renderedContent = templateEngine.process("/email/welcome.html", context); with a leading /, then it might be easiest to add the leading / to email/fragments/header.html as well.
Building a back-end app using Spring Boot 3.1
Using dependency:
which uses:
Rendering templates on the fly using the Template engine:
template directory layout:

welcome.html:
there is no problem rendering this template (without the fragment) using:
as soon as you add the fragment:
you get this error:
doesn't matter which fragment path you use:
The text was updated successfully, but these errors were encountered: