Thymeleaf
Thymeleaf
BirdMan98
心有灵犀一点通
展开
-
Thymeleaf 字符串处理
thymeleaf字符串处理判断是不是为空:<span th:if="${name} != null">不为空</span> <span th:if="${name1} == null">为空</span>判断是不是为空字符串: “”<span th:if="${#strings.isEmpty(name1)}">空的</span> 判断是否相同:<span th:if="${name} eq 'jack'"&g原创 2020-11-06 15:43:29 · 1656 阅读 · 0 评论 -
Thymeleaf JS传递多个变量参数
thymeleaf中给JS函数传递多个变量参数 <button class="mini ui red basic button" th:onclick="del([[${stu.id}]],[[${currentPage}]]);">删除</button>function del(id,page){ // alert("id:"+id+",pageNum:"+page); if (confirm("确认要删除这条数据吗?")){原创 2020-11-06 13:45:02 · 893 阅读 · 0 评论 -
Thymeleaf 传递url参数
使用Thymeleaf传递url参数路径变量(RESTful风格)<a href="#" th:href="@{/admin/{id}/delete(id=${comment.id})}" >删除</a>{xx} 设置参数名,末尾加(xx=) 即可设置路径变量url单参数(SpringMVC默认URL路径传单)<a th:href="@{/admin(page=${page.number}-1 )}" class=" item">查找</a>末原创 2020-11-01 09:55:38 · 1882 阅读 · 0 评论 -
Thymeleaf 循环打印1到指定的整数
在用thymeleaf末班获取后台的page对象时,我们需要进行分页页码的显示,通过page对象的totalPages可以获取到所有页面,那么获取到的这个整数,怎么循环打印出来呢?thymeleaf提供了一种函数#numbers.sequence(inta,intb)这个函数的作用是循环遍历a-b之间的整数下面给出例子<div class="page"th:each="i:${#......原创 2020-03-01 04:07:26 · 1078 阅读 · 0 评论 -
Thymeleaf 日期参数格式化
thymeleaf中对获取到的参数进行格式化的方式为了防止看不清,dates.format方法里的参数不要加${}注意格式的使用,dates是thymeleaf提供的对象具体参考:https://my.oschina.net/wangxinxx/blog/805077...原创 2020-02-28 00:45:48 · 665 阅读 · 0 评论