Thymeleaf Study Notes 3, thymeleaf Study Notes

Source: Internet
Author: User

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

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.