This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Problem using session while sending Ajax request to servlet... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem using session while sending Ajax request to servlet..." Watch "Problem using session while sending Ajax request to servlet..." New topic
Author

Problem using session while sending Ajax request to servlet...

aseem agarwal
Greenhorn

Joined: Oct 17, 2009
Posts: 9
Iam developing this simple web application where i need to send an AJAX request to a servlet to do some processing on data maintained in the session. But when I send the AJAX request the statement

request.getSession(false);

sometimes returns the right session as maintained and sometime returns null and the pattern is random.

I debugged the application and found that the session id sent with the request is different randomly. I haven't been able to find a good reason. Is it the browser failing to send the right session id, or is it problem with the Ajax request.

Please reply with any solutions.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem using session while sending Ajax request to servlet...