• 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

JSP to JSP communication problem by using AJAX

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,

I did an example on AJAX with Structs , when i send request from JSP to Action class i am able to get the req.responseXML object in the JSP.

Problem is: (In this example i am not using the Action class , directly from JSP i am calling another JSP with AJAX)When i am trying to send request from JSP to another JSP where i am producing the XML and flushed it. But in the first JSP i am not getting the responseXML object.

Sample Code used in 2nd JSP, where i am producing and returning the XML

response.setContentType("text/xml; charset=UTF-8");
response.setHeader("Cache-Control", "no-Cache");
//Here generated the XML in String Buffer (sb)
out.flush();
out.write(sb.toString);
 
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm no expert but if we have a look at the OutputStream it says


Flushes this output stream and forces any buffered output bytes to be written out



You call write after flush. Is this really the right way of doing this?
 
murali kankanala
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I mentioned the same code works good with Action class.

But if the same code written in the JSP it is not working.
 
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic