aspose file tools*
The moose likes Struts and the fly likes JSP to JSP communication problem by using  AJAX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "JSP to JSP communication problem by using  AJAX" Watch "JSP to JSP communication problem by using  AJAX" New topic
Author

JSP to JSP communication problem by using AJAX

murali kankanala
Ranch Hand

Joined: Nov 15, 2004
Posts: 110
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);
Mathias Nilsson
Ranch Hand

Joined: Aug 21, 2004
Posts: 367
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?


SCJP1.4
murali kankanala
Ranch Hand

Joined: Nov 15, 2004
Posts: 110
I mentioned the same code works good with Action class.

But if the same code written in the JSP it is not working.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP to JSP communication problem by using AJAX
 
Similar Threads
problem in implementing the AJAX with Struts
get/set attribute
Migrating Application - From Struts with AJAX to JSF with AJAX
get/set attribute
AJAX query