[aerogear-dev] double trouble

Erik Jan de Wit edewit at redhat.com
Wed May 22 08:28:28 EDT 2013


Hi,

Just to summarise here is what we found out when trying to create an Errai client for the TODO demo:

https://github.com/aerogear/TODO/pull/29

We have our own implementation that serialises JSON from and to objects that is compliant with Jackson and that seems to 'conflict' with the server implementation, because that is receiving Longs as javascript numbers. A number in Javascript is a Double and if you execute the following javascript you'll see that this leads to strange rounding problems 



var test = {"id":1,"name":"tag","tags":[10000000000000001]};
console.log(test.tags[0]);


The same exists in Java

https://gist.github.com/jfuerth/5372442

What I've added to the server side of the demo is the ability to receive the ids as Strings and then convert them on the server side where such a number limitation does not exists.

Cheers,
	Erik Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20130522/2528e101/attachment.html 


More information about the aerogear-dev mailing list