字面量

包括字符串、数字、布尔值、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: _

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>Title</title>
</head>
<body>
<h1>成功!</h1>
<!--th:text 将div里面的文本内容设置为 -->
<div id="div01" class="myDiv" th:id="${hello}" th:class="${hello}" th:text="${hello}">这是显示欢迎信息</div>
<hr/>
<div th:text="${hello}"></div>
<div th:utext="${hello}"></div>
<hr/><!-- th:each每次遍历都会生成当前这个标签: 3个h4 -->
<h4 th:text="${user}"  th:each="user:${users}"></h4>
<hr/>
<h4><span th:each="user:${users}"> [[${user}]] </span>
</h4>
<form th:action="@{/upload}" method="post" enctype="multipart/form-data"><input type="file" name="file"><input type="submit"/>
</form></body>
</html>

Thymeleaf语法变量相关推荐

  1. thymeleaf 语法——th:text默认值、字符串连接、th:attr、th:href 传参、th:include传参、th:inline 内联、th:each循环、th:with、th:if

    文章目录 1.表达式 1.1.简单表达式 1.2.三元运算.条件表达式: 1.3.默认表达式 1.4.综合使用,属性值的 if - else 2.字符串连接.拼接 3.th:attr 的使用 4.th ...

  2. Thymeleaf语法详解

      本文主要介绍下Thymeleaf的基本使用的语法. Thymeleaf语法详解 1.变量输出与字符串操作 1.1 基本用法 表达式 说明 th:text 在页面中输出值 th:value 可以将一 ...

  3. JS-概述-基本语法-变量-数据类型

    概述-基本语法-变量-数据类型 1 JavaScript 概述 ① JavaScript 的特点 JavaScript 是一门动态的,弱类型的,解释型的,基于对象的脚本语言. 动态: 程序执行的时候才 ...

  4. Thymeleaf $/*/#/@语法

    表达式符号 Thymeleaf对于变量的操作主要有$\*\#三种方式: 变量表达式: ${...},是获取容器上下文变量的值. 选择变量表达式: *{...},获取指定的对象中的变量值.如果是单独的对 ...

  5. idea中使用Thymeleaf语法编写代码不提示解决方法

    idea中使用Thymeleaf语法编写代码不提示解决方法 1.查看file-setting–pligins中thymeleaf是否开启 2.需要在pom工程中引入thymeleaf启动器坐标 < ...

  6. Python基础语法——变量

    一.Python 语言特点 1.简单易学:与C和Java比,Python的学习难度更低一点,更适合新手入门. 2.简洁明了.Python的语法非常简洁,代码量少,非常容易编写. 3.Python 是解 ...

  7. Thymeleaf 语法快速入门

    1.简介 官方网站:https://www.thymeleaf.org Thymeleaf是用来开发Web和独立环境项目的现代服务器端Java模板引擎. Thymeleaf的主要目标是为您的开发工作流 ...

  8. thymeleaf语法介绍

    Thymeleaf简介 官方网站:https://www.thymeleaf.org/index.html Thymeleaf是用来开发Web和独立环境项目的现代服务器端Java模板引擎. Thyme ...

  9. SpringBoot_web开发-thymeleaf语法

    我们看一下Thymeleaf的自动配置规则,我们得按照规则用起来,这里有一个自动配置,这里专门有一个thymeleaf,Thymeleaf的自动配置,ThymeleafAutoConfiguratio ...

最新文章

  1. Xposed源码剖析——hook具体实现
  2. 0/1背包问题-----回溯法求解
  3. J2EE搭建maven工程(选择使用jdk和增加资源文件夹)
  4. vba交付图表设计_您是在为交付目的而“设计”吗?
  5. java sub,Java 9子软件包跨模块拆分
  6. 公众号和小程序可以同名了 名称支持同主体复用
  7. Python变量、脚本名称、函数命名规范
  8. java源代码连接jsp,java网络五子棋的源代码-JSP教程,Java技巧及代码
  9. leetcode 148. Sort List ----- java
  10. JavaSE学习--面向对象
  11. 有符号char和无符号char
  12. Excel 哪个版本的好用?
  13. 【PROTEUS】使用PROTEUS与电脑串口调试助手进行通讯
  14. 深入浅出深度学习Pytroch
  15. 计算机考试成绩80分是统计指标值,某同学计算机考试成绩80分,这是统计指标值。...
  16. 【Python】《点燃我,温暖你》李峋同款爱心_python程序
  17. linux设备编号,linux设备号详解
  18. 十六进制颜色和RGB互转
  19. 英语——不定词(一)
  20. Google signin 引发的崩溃(人)

热门文章

  1. 【前端】跨浏览器事件处理程序EventUtil.js个人注释及详解
  2. 字符串在内存中的存储——C语言进阶
  3. 在.Net中进行跨线程的控件操作(上篇:Control.Invoke)
  4. VS2017-MFC-生成二维码测试小程序
  5. STM32L152RC 在keil4中使用printf()和scanf() 函数
  6. STVD下配置Cosmic编译器
  7. stdthread(8)并发recursive_mutex 递归锁
  8. 趣链 BitXHub跨链平台 (2)跨链网络拓扑
  9. C++(九)——职工信息管理系统
  10. nginx常用功能介绍