• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sending array of parameters to html from servlet

 
indu yeturu
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What JavaScript library are you using? Most (all) of them do this very easily.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
indu yeturu
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could do it that way, but why do it the hard way?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic