thymeleaf做if判定

<div class="showing">
<h2>条件判断</h2>
<p th:if="${testBoolean}" >如果testBoolean 是 true ,本句话就会显示</p>
<p th:if="${not testBoolean}" >取反 ,所以如果testBoolean 是 true ,本句话就不会显示</p>
<p th:unless="${testBoolean}" >unless 等同于上一句,所以如果testBoolean 是 true ,本句话就不会显示</p>
<p th:text="${testBoolean}?'当testBoolean为真的时候,显示本句话,这是用三相表达式做的':''" ></p>
</div>
————————————————
版权声明:本文为CSDN博主「日G一卒」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/likunpeng6656201/article/details/99442692

posted @ 2019-11-09 18:17  ukyo--夜王  阅读(4953)  评论(0编辑  收藏  举报