jsp 判断语句

作者:LoveEmperor-王子様

一、判断是否为空:
语句:not empty XX

 <c:if test="${not empty appDownloadUrl}"> 
   <div class="txt">App下载 </div>
 </c:if> 

二、判断是否为某个值(是否为true):
语句:true eq XX

<c:if test="${true eq invoiceEnable}">
    <div class="txt">电子发票</div>
</c:if>

三、其它判断:

<c:if test="value ne, eq, lt, gt,....">
!= ( ne )、 不等
< (lt )、 小于
> ( gt )、大于
>= ( ge ) 大于等于

四、java代码:

    model.addAttribute("appDownloadUrl", appDownloadUrl);
    model.addAttribute("invoiceEnable",true);

猜你喜欢

转载自blog.csdn.net/qq_31424825/article/details/81354489