Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how return Collection in accessor of ActionForm

 
Gerald Luckenbill
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking for sample code on how to create a method with the signature
Collection getOptions();
and populate it with Strings that will serve as the value and property for html ptions. (I am finding this tricky since Collection is an interface rather than a class - so I just want some sample code to see how it is done)
Ultimately what I am trying to do is populate an html:select and then the options - I was told that if I have a method with the above signature then the code in the jsp would look like:
<html:select property="someProperty"> (BTW - what does this someProperty have any meaning here>
<html ptions property"options"/>
</html:select>
I want to use this approach rather than some others where I have to use separate beans, because I can use the ActionForm of this jsp to store my data for the list/menu widget.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic