thymeleaf Simple use of grammar

Non null judgment of set

th:if="${not #lists.isEmpty( Custom collection )}"
String splicing
<span th:text="|Welcome to home, ${user.name}!|"> // This is actually equivalent to : <span th:text=
"'Welcome to home, ' + ${user.name} + '!'"> // Text substitution can be combined with other types of representations : <span th:text=
"${onevar} + ' ' + |${twovar}, ${threevar}|">
decimal ( rounding )
// display 1.24 th:text="${#numbers.formatDecimal(1.235, 1, 2)}"
a label - Hyperlinks
// display 1.24 <a th:href=
"@{/companyUser/getUserByUserName/(id=${companyUser.id},userName=${companyUser.userName})}"
>view</a> <a th:href="@{/companyUser/{companyUser.id}/getUserByUserName>view</a>
Ternary operator judgment
th:text="'Execution mode is ' + ( ('0'!='0')? 'Development' : 'Production')"

Technology
©2020 ioDraw All rights reserved
Self made whole person computer program PHP call shell command python Simple record of network programming layui.table Examples of dynamically getting header and list data Big data environment --- data warehouse (hive+mysql+hadoop) The construction of What are the types of variables ?MYSQL database DML Common commands 《 From machine learning to deep learning 》 note (2) Unsupervised learning log4j Method of printing exception stack information Android Development — Display food information according to customer budget