Thymeleaf Study Notes 3, thymeleaf Study Notes
10. attribute priority
11. Notes
11.1 <! --... --> Comments with HTML/XML
<!-- User info follows --><div th:text="${...}">...</div>
11.2 thymeleaf parser Annotation
Thymeleaf will be commented out during parsing, and it will be displayed when it is opened statically.
Single Row <! --/*... */-->
<!--/* This code will be removed at thymeleaf parsing time! */-->
Multiple rows:
<! --/* -->
...
...
<! --/* -->
<!--/*--> <div> you can see me only before thymeleaf processes me! </div><!--*/-->
11.3 static Parsing is commented out, And thymeleaf will be removed during parsing <! --/*/And/*/--> tag pair, content retained
<span>hello!</span><!--/*/ <div th:text="${...}"> ... </div>/*/--><span>goodbye!</span>
This annotation is useful when writing th: block.
<table> <!--/*/ <th:block th:each="user : ${users}"> /*/--> <tr> <td th:text="${user.login}">...</td> <td th:text="${user.name}">...</td> </tr> <tr> <td colspan="2" th:text="${user.address}">...</td> </tr> <!--/*/ </th:block> /*/--></table>
11.4 th: block applies to two <tr>
It cocould be useful, for example, when creating iterated tables that require more than one <tr> for each element