XMLHtpRequest object conflict
1 posts in topic
Flat View  Flat View

Posted By:   Scott_McRae
Posted On:   Tuesday, June 20, 2006 05:41 AM

We have been trying out some simple ajax code to call a struts action class to check whether the number of records displayed on an html page has changed and if so submit the form to display the new data.
The issue arrises when we have more than one session initiating the ajax call to the action class at the same time. When this condition occurs the return object is always empty.
Has anyone experienced this type of cross session conflict when executing the same action...?

Re: XMLHtpRequest object conflict

Posted By:   Barak_Ori  
Posted On:   Tuesday, June 20, 2006 07:59 AM

What AJAX framework are you using? This might be a problem with the framework. Generally speaking, XmlHttpRequests are regular HTML requests from the server side, so each request created an HttpServletRequest with a session and everything. It looks like your code or the framework code is problematic.

I would recommend using DWR for your AJAX calls. It's an excellent remoting framework. On the server side you won't have to write a Struts Action, but rather a function that returns an int, and DWR will handle the marshaling. Try it and see for yourself.

About | Sitemap | Contact