Thymeleaf语法变量
字面量
包括字符串、數字、布爾值、null、多個數據格式
Literals(字面量)
Text literals: ‘one text’ , ‘Another one!’ ,…
Number literals: 0 , 34 , 3.0 , 12.3 ,…
Boolean literals: true , false
Null literal: null
Literal tokens: one , sometext , main ,…
字符串操作
包括字符串拼接、字符串替換
Text operations:(文本操作)
String concatenation: +
Literal substitutions: |The name is ${name}|
數學運行
包括基本運算
Arithmetic operations:(數學運算)
Binary operators: + , ‐ , * , / , %
Minus sign (unary operator): ‐
布爾運算
包括并、或、非
Boolean operations:(布爾運算)
Binary operators: and , or
Boolean negation (unary operator): ! , not
比較運算
包括常用比較運算符
Comparisons and equality:(比較運算)
Comparators: > , < , >= , <= ( gt , lt , ge , le )
Equality operators: == , != ( eq , ne )
條件運算
包括常用條件表達式,支持三元運算符
Conditional operators:(條件運算)
If‐then: (if) ? (then)
If‐then‐else: (if) ? (then) : (else)
Default: (value) ?: (defaultvalue)
特殊操作
_,表示不進行任何操作
Special tokens:(特殊操作)
No‐Operation: _
總結
以上是生活随笔為你收集整理的Thymeleaf语法变量的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Thymeleaf表达式
- 下一篇: Thymeleaf循环遍历