小编Abr*_*kot的帖子

JSF不为null条件

使用JSF和EL,我基本上试图检查变量是否为null(或不是).

这是一段代码:

<p:dataGrid value="#{bean.graphiques}"
            var="graphique"
            rows="1" columns="3">
    <c:if test="#{not empty graphique}">
        <p:chart type="line" model="#{graphique}"/>
    </c:if>
    <c:if test="#{empty graphique}">
        <p:outputLabel>
            Add a new chart.
        </p:outputLabel>
    </c:if>
</p:dataGrid>
Run Code Online (Sandbox Code Playgroud)

首先检查,#{not empty graphique}总是假,即使graphique不是null.我试着用#{graphique ne null}#{graphique != null},但它是假的,太.

删除c:if语句后,将显示图表.因此,graphique不是空的.

我在很多网站上寻找解决方案 - 包括SO - 但是没有设法找到解决方案.

你知道发生了什么以及如何解决我的问题吗?

谢谢!

jsf el

4
推荐指数
1
解决办法
1万
查看次数

Extend a final class or replace it

"No, it can't be done"

It has been discussed a lot of times and the only reply is "No, it can't be done". But guys we do code. Everything is theoretically possible with some time.

Problem

Basically I'm trying to extend a final class to change a single behavior. That can't be done in a traditional way - at compile time with an extend keyword. I have looked for some other ways:

  • create a proxy - that works only for …

java final java-8

2
推荐指数
1
解决办法
165
查看次数

标签 统计

el ×1

final ×1

java ×1

java-8 ×1

jsf ×1