This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes How can I used html:select with a Collection of String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How can I used html:select with a Collection of String" Watch "How can I used html:select with a Collection of String" New topic
Author

How can I used html:select with a Collection of String

shah rah
Ranch Hand

Joined: Jan 04, 2007
Posts: 124
How can I use html:select with a Collection of Strings?

I have a session variable that has List of states. How to populate the drop down from this

html ptions collection="listofstates" is not working


java.util.Collection list = new java.util.ArrayList();
list.add("name1");
list.add("name2");
list.add("name3");
session.setAttribute("myList", list);

html:select property="selectedItem"
html ptions collection="myList"
html:select



Pls help
[ May 15, 2007: Message edited by: shah rah ]
 
GeeCON Prague 2014
 
subject: How can I used html:select with a Collection of String