• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

optionsCollection syntax trouble

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
<html:optionsCollection 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
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic