Two Laptop Bag*
The moose likes JSP and the fly likes populating jsp fields from java object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "populating jsp fields from java object" Watch "populating jsp fields from java object" New topic
Author

populating jsp fields from java object

mou haj
Ranch Hand

Joined: Sep 12, 2001
Posts: 81
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

Joined: Nov 06, 2000
Posts: 1510
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
}


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
 
subject: populating jsp fields from java object
 
Similar Threads
JSON response to populate listbox
Fire input text event Without Loosing Focus
JSON Object and Java Script DropDown
JSP page getting values from DB
JSON+Jquery