Tuesday, March 19, 2013

Re: Saving results from GWT-RPC call on client

Hello JeanV,

I made a googlecode project for you (and whoever else wishes to use the serialization library). I included instructions on how to use it. Check it out and let me know if there are problems. I'll try to fix them.

Cheers

On Tuesday, March 19, 2013 11:05:08 AM UTC+1, JeanV wrote:
Thanks Moneyboy,

Can you post an example of how you achieved this. Not the storage part but the implementation of the streamwriter on the client side.
Many thanks,

Jean

On Wednesday, October 10, 2012 9:30:31 AM UTC+2, monkeyboy wrote:
It is feasible. In my solution I used GWT-RPC's serialization but I had to tweak it since GWT-RPC messages are assymetric (the message sent from the client to the server is in a different format than the message sent from the server to the client even if they transfer the same object). Basically you have to make the serialization symetric. I did this by implementing the streamwriter to output the same message that the serverside would output. I did this basically by porting the server code to the gwt side. I then leveraged the already existing reader in the client and generated (by using generators) a class that returns the desired reader and writer. The reader is of course used to read the string and outputs the object and the writer takes the object and outputs the string. By using this method you can not only save results from RPC calls but any serializable object in the LocalStorage.
Since the storage in the LocalStorage is limited a further improvement is to compress the string. For this I use the LZMA algorithm which can compress the strings to about 60% of their original size. Based on my tests, bigger objects compress better but this is based on objects in my project and might not be the case for other kinds of objects.

Hope this helps.   
Regards,
           M

On Wednesday, October 10, 2012 7:13:20 AM UTC+2, JeanV wrote:
I was wondering if there's anyway to save the returned results from an RPC call to an HTML5 enabled browser. Basically the only way I have found would be to convert the results into strings and use LocalStorage to save them to the browser. I guess my question then would be how can IsSerializable java objects be converted to a string and back.
Any help would be appreciated.

Jean

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate