Arithmetic and Boolean
Aritmetic operations
Es kann auch gerechnet werden:
th:with="isEven=(${prodStat.count} % 2 == 0)"
Boolean: Vergleiche
Values in expressions can be compared with the > , < , >= and <= symbols, as usual, and also the == and != operators can be used to check equality (or the lack of it). Note that XML establishes that the < and > symbols should not be used in attribute values, and so they should be substituted by
<
and>
.
th:if="${prodStat.count} > 1"
th:text="'Execution mode is ' + ( (${execMode} == 'dev')? 'Development' : 'Production')"
Note that textual aliases exist for some of these operators: gt ( > ), lt ( < ), ge ( >= ), le ( <= ), not ( ! ). Also eq ( == ), neq / ne ( != ).