aspose file tools*
The moose likes Java in General and the fly likes How to persist data on client side Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to persist data on client side " Watch "How to persist data on client side " New topic
Author

How to persist data on client side

samir ware
Ranch Hand

Joined: Jul 27, 2005
Posts: 192
Hello Ranchers
I am developing a web application thought of a situation as in any AJAX call we have to go to server to fetch the data, so why not to persist the data which is going to be used frequently by the user. In order to do so , I wanna to persist the data on client side. May be in XML format.
Can anyone please tell me whether it is possible to store the data on client side in the XML format. And then fetch the data from that XML and show it to client . All this should be like a blackbox to the end user. I mean user should not be aware from where exactly his/her data is fetched from.
Any white paper any link will be greatly be apprieciated.
Thanks in advance
SAmir
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

Persist for what duration? For the current session you can use JavaScript. This is quite common in Ajax. If the persistence needs to span over multiple sessions you could try using cookies for this.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
samir ware
Ranch Hand

Joined: Jul 27, 2005
Posts: 192
Hello Rob,
Thanks for the reply. I want to persist my data in XML and that too across sessions. Is it not possible to save XML on client side at some perdefined location and use it as Database.
Thanks
Samir
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

Web servers have no access to the local file system except through cookies. Only with techniques like (signed!) applets, OCX controls and the like is it possible.
I'm not sure but I think you can store XML in cookies. That meets all your requirements except the specified location.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'd also be pretty wary of storing anything locally that could change on the server side without some sort of invalidation check.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to persist data on client side