<c:if test =“”>不起作用

时间:2017-02-27 15:05:07

标签: jstl

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

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

当我使用

  

$ {hasChild}

它在屏幕上显示为真,但它并没有在测试线上显示,我不知道为什么。有人可以帮忙吗?

1 个答案:

答案 0 :(得分:1)

您是否在测试开始之前声明了 hasChild ?即。

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