关于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>
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务