I have class where
@Enumerated(EnumType.STRING)
private StateOfDispatchToWD stateOfDispatchToWD = StateOfDispatchToWD.NONE;
And getter and setter:
public StateOfDispatchToWD getStateOfDispatchToWD() {
return stateOfDispatchToWD;
}
public void setStateOfDispatchToWD(StateOfDispatchToWD stateOfDispatchToWD) {
this.stateOfDispatchToWD = stateOfDispatchToWD;
}
and method:
public boolean isSuccessfullySentToWD() {
return zoj.getStateOfDispatchToWD() == StateOfDispatchToWD.SUCCESSFULLY_DISPATCH;
}
and call it from JSF:
<p:outputLabel value="OK"
rendered="#{Z.isSuccessfullySentToWD()}"/>
and sometimes I get:
[javax.enterprise.resource.webcontainer.jsf.lifecycle]
javax.el.ELException: //content/resources/zo.xhtml @240,92 rendered="#{Z.isSuccessfullySentToWD()}":
java.lang.NullPointerException:
javax.faces.FacesException:
javax.el.ELException: //content/resources/zo.xhtml @240,92 rendered="#{Z.isSuccessfullySentToWD()}":
java.lang.NullPointerException
but why? I'm afraid I don't understand. Thanks a lot.