【问题标题】:<c:if test=""> doesn't work [duplicate]<c:if test=""> 不起作用[重复]
【发布时间】:2017-07-18 06:14:51
【问题描述】:

我是 JSTL 的新手,由于某种原因,我无法让测试线工作。这是我正在使用的简化代码:

<c:if test="${hasChild}">
      test 
</c:if>

当我使用时

${hasChild}

它在屏幕上打印真实,但它在测试线上不起作用,我不知道为什么。有人可以帮忙吗?

【问题讨论】:

    标签: jstl


    【解决方案1】:

    您是否在考试开始前声明了 hasChild?即

    <c:set var="hasChild">*Something which makes this value true*</c:set>
    <c:if test="${hasChild}">
      test 
    </c:if>
    

    【讨论】:

      猜你喜欢
      • 2021-10-15
      • 2015-04-05
      • 2011-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-15
      相关资源
      最近更新 更多