users@glassfish.java.net

Re: Strange! One thread intercepting another threads response?

From: <glassfish_at_javadesktop.org>
Date: Sat, 10 Nov 2007 23:20:51 PST

Hello Kedar

Sorry, I will try to be more exact :-)

Let's say I have a servlet that receives an XML via HTTP POST (like an RPC). This can be for example info on a new customer that is to be stored in the database (let's call this servlet "CustomerServlet"). The servlet creates a new database record for the customer and then responds to the requesting server with an XML containing the customer number.

Now, the server also serves JSP pages used to show info from the database (for example listing customers among lots of other stuff).

Sometimes when I open such a JSP, the browser displays the XML that the CustomerServlet has created for another thread. So instead of displaying the JSP generated page, the server somehow takes the response from the CustomerServlet and sends it to the [b]browser [/b]instead of the server that triggered the CustomerServlet.

Mind you, that the CustomerServlet is never called or triggered by the JSP page/browser.

I don't think this was very clear either, but I find it difficult to explain...

As a last wrap-up:

Servlet A is invoked by server X
JSP B is invoked by browser Y

Usually servlet A responds to server X with an XML
and
JSP B generates text that is sent to browser Y

The question is why browser Y sometimes get the XML that was to be sent by servlet A to server X.

Either servlet A for some reason sends its response to browser Y, even though they were never in contact. This seems unlikely, of course.
Or, JSP B somehow intercepts the response object for servlet A and then returns that content to the browser Y. Equally unlikely.

So, I'm at a loss here...

Sorry I can't explain this any better...

Thanks

Marius
[Message sent by forum member 'mariusw' (mariusw)]

http://forums.java.net/jive/thread.jspa?messageID=244932