I have the following project structure in Spring Boot Application -
/templates/home/index.html
/templates/includes/header.html
I want to include the header file inside the index file. I have tried the link - https://stackoverflow.com/questions/23538693/include-html-page-in-thymeleaf#=
But the colon '::' is showing error.
I am new to thymeleaf. Can anybody explain? Thanks.
Thanks all who tried to help me. I solved the problem as follows -
//header.html
<div th:fragment="header">
<!-- related code of header file >
</div>
//index.html
//to include header follow the code( the header file is inside includes directory)
<div th:replace="/includes/header :: header"> </div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With