Thymeleaf标签使用

标签

Fragment inclusion(片段包含)

  • th:insert
  • th:replace

Fragment iteration(遍历)

  • th:each

Conditional evaluation (条件判断)

  • th:if
  • th:unless
  • th:switch
  • th:case

Local variable definition(声明变量)

  • th:object
  • th:with

General attribute modification(任意属性修改,支持perpend ,append)

  • th:attr

  • th:attrprepend

  • th:attrappend

Specific attribute modification(修改指定属性默认值)

  • th:value
  • th:href
  • th:src

Text(修改标签体内容的)

  • th:text(转义特殊字符)
  • th:utext(不转义特殊字符)

Fragment specification(声明片段)

  • th:fragment

表达式语法

简单表达式

  • 变量表达式:${...}
  • 选择变量表达式:*{...}
  • 消息表达式:#{}
  • 链接网址表达式:@{ }
  • 片段表达式:~{ }

算术运算符

+,-,* ,/ ,%

布尔运算符

二进制:and,or

布尔否定:!,not

比较和相等运算符

比较运算符:&gt ; &lt ;

相等运算符:==,!=(eq,ne)

原文地址:https://www.cnblogs.com/striver20/p/14244903.html