【问题标题】:c:if condition not evaluating to truec:if 条件不为真
【发布时间】:2013-07-18 10:33:13
【问题描述】:

我在xhtml 中有以下代码,其中appprimefaces dataTable 中的一个变量:

${app.paas.id_paas == var.DESIGN_APP}

<c:if test="${app.paas.id_paas == var.DESIGN_APP}">
    <script>
        console.log("inside!");
    </script> 
</c:if>

页面打印true,但控制台不打印inside!。 为什么c:if没有进入条件?

【问题讨论】:

    标签: if-statement primefaces datatable xhtml


    【解决方案1】:

    这是因为您使用的是 JSTL 而不是 facelets。 你的

    c:if
    

    代码在构建时间执行,而您的 primefaces 变量在渲染时间处理。 完整解释见这里:JSTL in JSF2 Facelets... makes sense?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-03
      • 1970-01-01
      • 1970-01-01
      • 2011-03-21
      • 2014-03-06
      相关资源
      最近更新 更多