This is a Seam application.
HTML
<h:selectManyCheckbox value="#{officeCriteria.carrier}">
<f:selectItem itemValue="ATT" itemLabel="ATT" />
<f:selectItem itemValue="VZB" itemLabel="VZB" />
</h:selectManyCheckbox>
backing bean OfficeCriteria:
private List<String> carrier;
public List<String> getCarrier() {
return carrier;
}
public void setCarrier(List<String> carrier) {
this.carrier = carrier;
}
When I load the page I get a null pointer exception on carrier. What am I doing wrong?
2:10,963 ERROR [viewhandler] Error Rendering View[/ONDSearchPage.xhtml]
javax.faces.FacesException: javax.el.ELException: /ONDSearchPage.xhtml @264,81 value="#{officeCriteria.carrier}": Error reading 'carrier' on type dne.nmt.ond.model.OfficeCriteria_$$_javassist_seam_6
at javax.faces.component.UIOutput.getValue(UIOutput.java:187)
at com.sun.faces.renderkit.html_basic.MenuRenderer.getCurrentSelectedValues(MenuRenderer.java:593)
at com.sun.faces.renderkit.html_basic.SelectManyCheckboxListRenderer.encodeEnd(SelectManyCheckboxListRenderer.java:117)
....
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.el.ELException: /ONDSearchPage.xhtml @264,81 value="#{officeCriteria.carrier}": Error reading 'carrier' on type dne.nmt.ond.model.OfficeCriteria_$$_javassist_seam_6
at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
at javax.faces.component.UIOutput.getValue(UIOutput.java:184)
... 95 more
Caused by: java.lang.NullPointerException
at dne.nmt.ond.model.OfficeCriteria.getCarrier(OfficeCriteria.java:108)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
.....
at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
... 96 mor