Monday, July 6, 2015

Guidance on transmitting JSON data

I have a javascript widget (note, not gwt widget) that takes a javascript object as input.  If I have the JSON representation of this object as a string I can turn it into a javascript object using JSON.parse() and everything works fine.

However, the data itself will be generated on the server.  From what I can tell, I have two options:

 * Create a GWT-RPC servlet and transfer the json as a string

 * Create a standard servlet, set the response type as "application/json", and then write the json as string to the response stream that's retrieved using a request builder

With both of these cases I'd be gzipping the response.  

I'm asking because the json response data can get quite large.  Are there any other options I'm missing?  Is there a binary / encoded option other than strings or is the gzipping good enough?

Generally, are there any best practices for transferring large json data using GWT?

Thanks!

--
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.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment