File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes optionsCollection syntax trouble Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "optionsCollection syntax trouble" Watch "optionsCollection syntax trouble" New topic
Author

optionsCollection syntax trouble

Jeff Horan
Ranch Hand

Joined: Apr 03, 2003
Posts: 37
I am trying to populate an html:select with a collection from the action class. In my action class I populate an ArrayList with LabelValueBeans. I then do:
selectForm.setNamesOptions(arrayList);
return mapping.findForward("success");//which is back to the same page
My jsp:
<htmlptionsCollection name="selectForm" property="namesOptions"/>
My struts-config:
<form-property name="namesOptions" type="java.util.Collection" />
What am I doing wrong, how can I fix it?
Thanks
Eric Sexton
Ranch Hand

Joined: Sep 12, 2003
Posts: 133
Here is how I dispay my collections in the jsp

The property of the select tag is corresponds to name select element on the form. The collection parm corresponds to the name of the collection. The two properties are from the bean that creates my collection. It just pulls them right in.
 
Don't get me started about those stupid light bulbs.
 
subject: optionsCollection syntax trouble
 
Similar Threads
retrieve drop down value
Problem submitting html:select value
Regarding Logic iterate
Populating a selectbox a clean solution
Struts ArrayList Display in JSP