This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: populating jsp fields from java object
 
Similar Threads
JSON response to populate listbox
JSON+Jquery
JSON Object and Java Script DropDown
Fire input text event Without Loosing Focus
JSP page getting values from DB