File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes client could not get update session data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "client could not get update session data" Watch "client could not get update session data" New topic
Author

client could not get update session data

david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 133
Hi,

I need to retrieve data and update a web page every few seconds. I had a problem to get updated session data from client side. I use a ajax call (in jsp file) to send request to struts action, which perform the request and saved java object data in the session. Then the jsp file (which sent request) use javascript to create a table dynamically, but the problem is that the javascript always get old session data, unless the jsp page is refresh, which is not wanted.

I have cleared the catch both in jsp file and in server side, and wondering what is the reason of the problem?

Thanks for the help!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

When using Ajax the page doesn't access the server except though the Ajax request, so how could it possibly know anything about session data?

The only new data that the page gets is from the Ajax response.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 133
oh i see. Thank you for the clarification. I am looking at json (did not use it before), I am thinking to return json object (convert java object to json obj) to client side and use javascript to parse it. Is there any other better solution?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

Better in what way?
david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 133
I mean in other way like using xml instead of json, I think they are not big difference between them, just the data format difference.

I got another problem, in struts 1, I usually handle the request and forward reponse to a jsp file , as result jsp file got a form. Now I use ajax to call the action, the action handle request and convert java object to json ( ), how could I get that from jsp file? As I know, strus only forward the action form to jsp file.

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: client could not get update session data
 
Similar Threads
How to use Servelet to pass binary data
help needed Regarding tree Structure
HELP! Weird Include problem!
JavaScript in jsp : Bad Practice ?
How send file data to JSP/Servlet page and save to disk?