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

calling servlet from ajax

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I have a servlet A that I would call on a button click using AJAX. It checks certain things posted and if invalid comes back with error xml, which gets displayed on the same page.
In Valid case, I want to forward request and response objects to another servlet B, that would gather data from database and render the page using the response object.
This case is not working well for me. Here the callback JS function would not have anything to do in the page.
request.responseXML is null but request.responseText has the entire html document. I am wondering how in the callback JS I could take this document and replace the one in current window.document
Please help...any ideas about how to get this?
I would really dislike to have a response xml from servlet A in callback JS, that we would need to check and make another client to server (to servlet B) call to show second page...
any ideas???
thanks in advance,
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Amit,

I'm going to move this to our HTML/Javascript forum where you are likely to get a better answer.
 
Amit Da
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
please just delete it instead. I couldnt.
it's already posted there a post before
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please don't cross-post your questions.
Doing so causes duplication of effort and confusion.

Once someone has noticed that the question they just spent time answering was already answered in another forum, they are likely to become annoyed enough with you that they will never want to answer another question of yours.

For more tips on asking questions here, see:
http://faq.javaranch.com/view?HowToAskQuestionsOnJavaRanch
    Bookmark Topic Watch Topic
  • New Topic