Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

populating jsp fields from java object  RSS feed

 
mou haj
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Say i have a list box. Right now what I need to do is to populate this select box from a java object. How do I do this. Can anybody send me code ??? This is a demi. I need to populate the java object in the JSP code itself. How to do this. Please help
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iterate through the collection that contains what goes in the listbox and just add it to the listbox.
Iterator j = yourList.iterator()
while(j.hasNext())
{
perform appropriate castto get the object
add it to the listbox/combobox
}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!