Thymeleaf-User Manual

Official website

Official document

grammar

  • Simple expression:
    • Variable expression: ${...}
    • Select variable expression: *{...}
    • Message expression: #{...}
    • Link URL expression: @{...}
    • Fragment expression: ~{...}
  • Text
    • Text: 'one text', 'Another one!', ...
    • Digital: 0, 34, 3.0, 12.3, ...
    • Boolean value: true,false
    • Null: null
    • Literal tokens: one, sometext, main,…
  • Text operation:
    • String concatenation: +
    • Literal substitution: |The name is ${name}|
  • Arithmetic operations:
    • Binary operators: +, -, *, /,%
    • Negative sign (unary operator): -
  • Boolean operation:
    • Binary operators: and,or
    • Boolean negation (unary): !,not
  • Judgment and comparison:
    • Comparator: >, <, >=, <=( gt, lt, ge, le)
    • Equality operators: ==, !=( eq, ne)
  • Conditional operation mark:
    • If-then: (if) ? (then)
    • If-then-else: (if) ? (then) : (else)
    • Default: (value) ?: (defaultvalue)
  • Special symbols:
    • No-Operation: _

use

Extract public pages

  • th:fragment="sidebar"
  • th:replace="~{commens/commens::sidebar}"

Guess you like

Origin blog.csdn.net/qq_37768368/article/details/109096444