aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 1506
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: populating jsp fields from java object
 
Similar Threads
Fire input text event Without Loosing Focus
JSON Object and Java Script DropDown
JSP page getting values from DB
JSON response to populate listbox
JSON+Jquery