Difference between Thymeleaf include and replace?

According to documentation if you have this situation: <div th:include=”…”> content here </div> fragment will be placed inside <div> tag. However when you use replace: <div th:replace=”…”> content here </div> then <div> will be replaced by content. Thymeleaf can include parts of other pages as fragments (whereas JSP only includes complete pages) using th:include (will … Read more

How to add source code comments in Thymeleaf templates that don’t get included in generated HTML?

Version 2.1 is released so now you can upgrade your libraries and use comments in your code. With this version developers are able to use parser-level comment blocks: <!–/* This code will be removed at thymeleaf parsing time! */–> and prototype-only comment blocks: <span>hello!</span> <!–/*/ <div th:text=”${…}”> </div> /*/–> <span>goodbye!</span> Detailed explanation can be found … Read more

error code: 521