I’ve been using Java officially at work for a few months now, and Thymeleaf is the big one. I don’t like it, but I do it for a living, so here’s a summary. I discovered that I had a code that pretty much encapsulates what I’ve learned about Thymeleaf at this stage.

<! --/* This comment format is unique to thymeleaf and is not visible when the page is output. 
<! --/* Pass parameters */-->
<block th:fragment="submenu(curicon)">

<script th:inline="javascript">let url = [[${/path}]]''; ${path} is null, url = '';</script>

<div class="dock hide">
    <! --/* marginleft is optional */-->
    <div th:style="'margin-left:' + ${marginleft ? : '37'} + '%; '">
	<! --/* Variable definition */-->
        <th:block th:with="Docks = ${{{1, 'loose', 'FZJZ /? P =tf'}, {2,' crane ',' FZJZ /global'}, {3,' turtle ',' FZJZ /? P = jx '}, {4, 'deer', 'FZJZ /? P = cloud '}, {5, 'the Antarctic xian weng', 'FZJZ/dolphin'}, {6, 'ding spring and autumn period,' FZJZ/boat '}}}">
	    
	    <! - / * * / -- - >
            <th:block th:each="d:${docks}">
                <div class="dock-icon" th:title="${d[1]}" th:url="${d[2]}">
                    <div><img th:src="@{/images/dock/} + ${d[0]} + ${d[1]} + '.png'" th:alt="${d[1]}"/></div>
					<! - / * * / -- - >
                    <div><span th:text="${d[1]}" th:class="${curicon eq d[0]} ? active"></span></div>
                </div>
            </th:block>
        </th:block>
    </div>
</div>
</block>
Copy the code

Thymeleaf fragments optional parameter thymeleaf defines variables such as thymeleaf to set path thymeleaf thymeleaf