Error Rendering View[test.xhtml]
java.lang.NullPointerException
at org.primefaces.component.orderlist.OrderListRenderer.encodeOptions(OrderListRenderer.java:149)
at org.primefaces.component.orderlist.OrderListRenderer.encodeList(OrderListRenderer.java:108)
at org.primefaces.component.orderlist.OrderListRenderer.encodeMarkup(OrderListRenderer.java:79)
at org.primefaces.component.orderlist.OrderListRenderer.encodeEnd(OrderListRenderer.java:49)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:519)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:543)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:315)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:150)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:519)
at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:60)
at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:44)
at org.primefaces.component.dialog.DialogRenderer.encodeContent(DialogRenderer.java:174)
at org.primefaces.component.dialog.DialogRenderer.encodeMarkup(DialogRenderer.java:103)
at org.primefaces.component.dialog.DialogRenderer.encodeEnd(DialogRenderer.java:41)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:519)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:626)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:622)
at org.primefaces.component.accordionpanel.AccordionPanelRenderer.encodeEnd(AccordionPanelRenderer.java:60)
@FacesConverter("contactConverter") 公共类 ContactConverter 实现 Converter{
@Override
public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2)
throws ConverterException {
// TODO Auto-generated method stub
TestBean tb= new TestBean();
tb.setName(arg2);
return tb;
}
@Override
public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2)
throws ConverterException {
// TODO Auto-generated method stub
return arg2.toString();
}
我正在使用 primefaces 订单列表示例。但我正面临这个空指针异常。谷歌搜索后,我发现这个问题与转换器有关,但我不确定。任何人都可以帮助我使用转换器的简单 primeface 订单列表。