This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
shah rah
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic