Gotchas Of JSF

javax.servlet.jsp.JspException: ServletException in ‘/pages/secure/secureContact.jsp’: Array referenced by UISelectItems with binding ‘#{loggedInContactBean.subjectsOptions}’ and Component-Path : {Component-Path : [Class: org.ajax4jsf.component.AjaxViewRoot,ViewId: /secureContact.jsp][Class: org.apache.myfaces.custom.div.Div,Id: wrapper][Class: javax.faces.component.UINamingContainer,Id: body][Class: org.apache.myfaces.custom.div.Div,Id: _idJsp76][Class: org.apache.myfaces.custom.div.Div,Id: _idJsp88][Class: org.apache.myfaces.custom.div.Div,Id: _idJsp89][Class: org.apache.myfaces.custom.div.Div,Id: _idJsp90][Class: javax.faces.component.html.HtmlForm,Id: form1][Class: com.exadel.htmLib.components.UITable,Id: _idJsp93][Class: com.exadel.htmLib.components.UITbody,Id: _idJsp94][Class: com.exadel.htmLib.components.UITr,Id: _idJsp117][Class: com.exadel.htmLib.components.UITd,Id: _idJsp120][Class: javax.faces.component.html.HtmlSelectOneMenu,Id: _idJsp121][Class: javax.faces.component.UISelectItems,Id: _idJsp122]} does not contain Objects of type SelectItem

jsp code:

<h:selectOneMenu value=”#{loggedInContactBean.subject}”>

<f:selectItems value=”#{loggedInContactBean.subjectsOptions}” />


I was continuously getting this error… The reason was that my f:selectItems value Object(subjectsOptions)  was greater in size and it was holding less objects of select Items.

Making the size equal to the objects it holds removed this error. Strange but it behaves this way.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: