File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

updating a table using Ajax?

 
Rajesh Khan
Ranch Hand
Posts: 230
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i am currently planning to update a table on a jsp asynchronously using the following method
A couple of parameters are passed to a servlet as such


Now the only way i know for receiving the response asynchronously is


This means all the data which will be passed from the Servlet to the jsp asynchronously will be through the printwriter object.
I wanted to know is this the only way of passing the data from the servlet to the jsp ?? so if i wanted to write an entire table will i first have to write the table out on a string and then send it through printwriter or how ??
Is even querying a table asynchronously sensible ??
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64175
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have the servlet forward to a JSP that formats the table and returns the HTML fragment as the response. Your on-page script can then just replace the table in the DOM.

P.S. This would be a lot easier with the jQuery load() method.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic