以编程方式添加复合组件时出现以下异常
java.lang.NullPointerException: null
at com.sun.faces.application.view.FaceletViewHandlingStrategy.getComponentMetadata(FaceletViewHandlingStrategy.java:220) ~[javax.faces.jar:2.1.6-SNAPSHOT]
at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:938) ~[javax.faces.jar:2.1.6-SNAPSHOT]
at javax.faces.application.ApplicationWrapper.createComponent(ApplicationWrapper.java:605) ~[javax.faces.jar:2.1.6-SNAPSHOT]
at javax.faces.application.ApplicationWrapper.createComponent(ApplicationWrapper.java:605) ~[javax.faces.jar:2.1.6-SNAPSHOT]
at javax.faces.application.ApplicationWrapper.createComponent(ApplicationWrapper.java:605) ~[javax.faces.jar:2.1.6-SNAPSHOT]
at javax.faces.application.ApplicationWrapper.createComponent(ApplicationWrapper.java:605) ~[javax.faces.jar:2.1.6-SNAPSHOT]
at org.omnifaces.util.Components.includeCompositeComponent(Components.java:320) ~[omnifaces-1.6.jar:1.6]
Components.includeCompositeComponent(form,
"ccomp", "ccomponent.xhtml", "ccomponentId");
javax.faces.PARTIAL_STATE_SAVING = true
时不会出现NPE。但是当true
时,在其他地方会出现重复的ID错误。
如何解决这个问题?