khhaaannnnn
khhaaannnnn

Reputation: 144

SpringBoot Thymeleaf Not Resolving Template

I'm using SpringBoot 1.3.3.RELEASE and Thymeleaf with IntelliJ as my ide. I'm getting this error:

org.thymeleaf.exceptions.TemplateInputException: Error resolving template "footer.html", template might not exist or might not be accessible by any of the configured Template Resolvers (about:102)

I have this project layout: enter image description here

I'm using this import on the about.html file:

<div th:replace="footer.html"></div>

I can't get it to work via IntelliJ or the SpringBoot Maven plugin. I'm using the embedded Tomcat to run this project. I've tried placing the fragment into a fragment folder under the templates and also this

<div th:fragment="footer.html"></div>

Any help would be appreciated.

Upvotes: 0

Views: 1484

Answers (1)

What does your footer.html look like? If you want to use a fragment you have to do it like that:

<div th:replace="footer :: fragmentName"></div>

Inside footer.html you would have something like

<div th:fragment="fragmentName">Hello World</div>

Upvotes: 2

Related Questions