Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic