关于thymeleaf中th:if的使用

运用于判断表达式中时,关系判断使用 gt / ge / eq / lt / le / ne (即:使用缩写)

gt:     great than(大于)>
ge:    great equal(大于等于)>=
eq:    equal(等于)==
lt:    less than(小于)<
le:    less equal(小于等于)<=
ne:    not equal(不等于)!=

以 th:if 为例

<td th:if="${user} ne null">
<!-- 此处 ne 若是替换成 not equal 或 != , 则会判断错误,无法正常执行 -->
	用户名:<font>[[${user.username}]]</font>
</td>
发布了302 篇原创文章 · 获赞 61 · 访问量 7633

猜你喜欢

转载自blog.csdn.net/LawssssCat/article/details/104085463