wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes sending array of parameters to html from servlet 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 » Engineering » HTML, CSS and JavaScript
Bookmark "sending array of parameters to html from servlet" Watch "sending array of parameters to html from servlet" New topic
Author

sending array of parameters to html from servlet

indu yeturu
Ranch Hand

Joined: Aug 27, 2008
Posts: 123
Hi all,

My html code contains a dropdown box, which has to be loaded with the values of database. For this I connected to Servlet with Ajax, there I have database values.
Now I need to send these array of string values to html. How to send an array of strings to html from servlet?
please can I get detailed solution ?, as am very very new to Ajax..

thanks inadvace


thanks,
indu
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What JavaScript library are you using? Most (all) of them do this very easily.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

For example, with jQuery's load() method, you can format the options on the server (using a JSP or PHP or whatever) and just load them into the <select> element with:


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
indu yeturu
Ranch Hand

Joined: Aug 27, 2008
Posts: 123
thank you somuch for your suggetions.. I will gothrough JQuery..
Upto now, i thought of getting values in some xml format from servlet to html and rearranging....
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

You could do it that way, but why do it the hard way?
 
 
subject: sending array of parameters to html from servlet
 
Similar Threads
servlets sending data to jsp
Dynamically populating drop down menu with database values
Populating HTML select using JSON
problem in adding a new row for the user input data
sending a Collection from JSP to Servlet