java.lang.NullPointerException: at com.sun.faces.renderkit.h



我正在尝试在我的 Web 应用程序中使用新的直通属性功能,但是我在可为空的属性方面遇到了问题。这是代码:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" 
      xmlns:util="http://xmlns.jcp.org/jsf/composite/util"
      xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
...
<p:outputPanel  pt:example="#{mybean.nullableAttribute}"  >
...
</p:outputPanel>

我收到异常:

ERROR  javax.enterprise.resource.webcontainer.jsf.application 12:01:09.205 [http-listener-1(3)]  - Error Rendering View[/index.xhtml]
java.lang.NullPointerException: null
    at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.getAttributeValue(HtmlResponseWriter.java:1215) ~[javax.faces-2.2.6.jar:2.2.6]
    at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.flushAttributes(HtmlResponseWriter.java:1175) ~[javax.faces-2.2.6.jar:2.2.6]
    at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.closeStartIfNecessary(HtmlResponseWriter.java:1117) ~[javax.faces-2.2.6.jar:2.2.6]
    at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.startElement(HtmlResponseWriter.java:646) ~[javax.faces-2.2.6.jar:2.2.6]
    at org.primefaces.component.growl.GrowlRenderer.encodeEnd(GrowlRenderer.java:38) ~[primefaces-4.0.jar:4.0]
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) ~[javax.faces-2.2.6.jar:2.2.6]
    at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:74) ~[primefaces-4.0.jar:4.0]
    at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:57) ~[primefaces-4.0.jar:4.0]
    at org.primefaces.component.outputpanel.OutputPanelRenderer.encodeMarkup(OutputPanelRenderer.java:64) ~[primefaces-4.0.jar:4.0]
    at org.primefaces.component.outputpanel.OutputPanelRenderer.encodeEnd(OutputPanelRenderer.java:40) ~[primefaces-4.0.jar:4.0]
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) ~[javax.faces-2.2.6.jar:2.2.6]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1864) ~[javax.faces-2.2.6.jar:2.2.6]
    at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) ~[javax.faces-2.2.6.jar:2.2.6]
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) ~[javax.faces-2.2.6.jar:2.2.6]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1857) ~[javax.faces-2.2.6.jar:2.2.6]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860) ~[javax.faces-2.2.6.jar:2.2.6]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860) ~[javax.faces-2.2.6.jar:2.2.6]

当属性为空时。当它不为空时,它确实有效。我已经尝试过 mojarra 2.2.0 和 2.2.6(我在玻璃鱼 4.0 上)

有什么想法吗?

谢谢!

此错误

已报告为问题 3208 已在 Mojarra 2.2.7 中修复。

因此,至少升级到该版本应该可以。 目前,它已经在 2.2.8。

我终于使用了自定义EL函数

相关内容

  • 没有找到相关文章

最新更新