开发者社区 问答 正文

Thymeleaf中表达式支持的语法有哪些?

Thymeleaf中表达式支持的语法有哪些?

展开
收起
问问小秘 2020-04-29 17:07:55 674 分享 版权
1 条回答
写回答
取消 提交回答
  • 字面量(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

    文本操作(Text operations)

    字符串连接(String concatenation): +

    文本替换(Literal substitutions): |The name is ${name}|

    ...
    //Which is equivalent to: 算术运算(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)三元运算符 循环 渲染列表数据是一种非常常见的场景,例如现在有n条记录需要渲染成一个表格或li列表标签该数据集合必须是可以遍历的,使用th:each标签
    2020-04-29 17:08:32
    赞同 展开评论
问答地址: