2
votes

I have java objects used in GWT RPC calls. On the GWT client I need to store these objects in a web sql database. I need to be able to convert these objects to a string and then also de-serialize them from the string. I have seen many aproaches JSON, AutoBean, various other libraries but none seem to be able to handle circular references which I do have in my objects.

Anyone know of a GWT library that can handle my requirements?

GWT RPC itself transmit responses to the client using JSON and handles circular references okay (at least I think so) - So I cannot see why this mechanism cannot be re-used. Any ideas?

1

1 Answers

0
votes

If the Web SQL service conforms to JAX-RS or Jackson JSON, use RestyGWT.

There is no conversion necessary on your part. RestyGWT encodes your POJOs to Jackson-compliant JSON.

The flip-side is you would have to read up on JAX-RS, JAXB, Jackson annotations. Which is not a flip-side to me but an exciting opportunity to learn a widely used web service technology.

GWT RPC itself transmit responses to the client using JSON

      • that is an inaccurate perception.
  • GWT RPC object encoding is deliberately obfuscated and difficult to decipher and format stability is not guaranteed from version to version.
  • there is no json in the RPC data interchange.

If your statement were true, then you would not have needed a servlet that extends GWT RemoteServiceServlet to service a RPC request.

BTW, what web SQL service is that? Proprietary in-house?