Hi,
Regarding the subject matter above, when I open the JSP page that have the selectItems component looping the collection object, it generates error that says that the content of the Collection object is not instanceOf SelectItem.
The collection object that I had mentioned was bundled in a JAR file and that JAR file was inside the root of the EAR file. Refer to the example below:
Example no. 1
public class Person{ private String name; private String gender; private List gendersList; public String getName(){ return this.name; } public void setName(String name) { this.name = name; } public String getGender(){ return this.gender; } public void setGender(String gender) { this.gender= gender; } public List getGendersList(){ gendersList = new ArrayList(); genderList.add( new SelectItem("m", "Male", null) ); genderList.add( new SelectItem("f", "Female", null) ); return genderList; } } public class PersonBean extend Person{ public String action(){ < ...do action here... > } } ... in JSP ... <h:selectOneRadio id="gender" value="#{person.gender}"> <f:selectItems value="#{person.gendersList}" /> </h:selectOneRadio>
<application> <display-name>Project</display-name> <module> <java>GuestBook.jar</java> </module> <module> <web> <web-uri>guestbook.war</web-uri> <context-root>gb</context-root> </web> </module> </application>