Table of contents
Thymeleaf syntax (most commonly used)
How to remove the floating red problem in the thymeleaf template in idea
Thymeleaf syntax (most commonly used)
-
get variable value ${...}
<!--Do not escape--> <div th:text="${msg}"></div> <!--Escape--> <div th:utext="${msg}"></div>
-
Link expression: @{…} , similar tags are:
th:href
andth:src
<a href="details.html" th:href="@{/order/details(orderId=${o.id})}">view</a>
-
cycle
model.addAttribute("users", Arrays.asList("aaa","bbb"));
<h2 th:each="user:${users}" th:text="${user}"></h2> <!--<h2 th:each="user:${users}">[[${user}]]</h2>-->
How to remove the floating red problem in the thymeleaf template in idea
open settings
Select editor, then open Inspections
Search for thymeleaf and remove the check box behind the Expression variables validation option, and finally click Apply
Fluttering red has disappeared