• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

updating a table using Ajax?

 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ??
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic