使用列表时出现JSF selectOneMenu标记错误

使用列表时出现JSF selectOneMenu标记错误,jsf,selectonemenu,Jsf,Selectonemenu,我使用JSF标记h:selectOneMenu作为下拉列表 <h:selectOneMenu id="subscriberName" value="#{manageSubscriberInformation.subscriberName}" <f:selectItem itemValue="" itemLabel="" /> <f:selectItems value="#{manageSubscri

我使用JSF标记h:selectOneMenu作为下拉列表

<h:selectOneMenu id="subscriberName" value="#{manageSubscriberInformation.subscriberName}" 
    <f:selectItem itemValue="" itemLabel="" />                            
    <f:selectItems value="#{manageSubscriberInformation.subList}" />
</h:selectOneMenu> 

无法理解导致问题的原因。

该异常相当自我解释

java.lang.IllegalArgumentException:UISelectItems(…)引用的集合不包含SelectItem类型的对象

{manageSubscriberInformation.subList}
必须返回一个
列表
SelectItem[]
,其中
SelectItem

只有在JSF2.0之后,才不再需要特别指定
SelectItem

另见:
java.lang.IllegalArgumentException: Collection referenced by UISelectItems with binding '#{manageSubscriberInformation.subList}' and Component-Path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/manageSubscriber.jsp][Class: javax.faces.component.UINamingContainer,Id: body][Class: javax.faces.component.html.HtmlForm,Id: c][Class: javax.faces.component.html.HtmlSelectOneMenu,Id: subscriberName][Class: javax.faces.component.UISelectItems,Id: _idJsp143]} does not contain Objects of type SelectItem