jQuery in Action, 2nd edition*
The moose likes HTML, CSS and JavaScript and the fly likes updating a table using Ajax? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "updating a table using Ajax?" Watch "updating a table using Ajax?" New topic
Author

updating a table using Ajax?

Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
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

Joined: Jan 10, 2002
Posts: 60766
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: updating a table using Ajax?
 
Similar Threads
updating a table on jsp using jquery complex scenario
Passed, just passed...
IBM 154 q&a passed: 66.7%
Passed!
Passed