How to deserialize BigDecimal by using GWT AutoBean?

我是研究僧i 提交于 2020-01-04 13:05:23

问题


I have json coming from server and representing pojos. When i deserialize to json using AutoBean some works some dont! I figure out that those which cant be deserialize has BigDecimal getters/setters.

Error:

TypeError: Cannot read property 'length' of undefined at java_math_BigDecimal_$initFrom__Ljava_math_BigDecimal_2Ljava_lang_String_2

How to handle BigDecimal into GWT while deserializing with AutoBean?

ps:

the nested question is this one


回答1:


AutoBean expects BigDecimal as strings in the JSON payload.

We discussed it at http://gwt-code-reviews.appspot.com/1601805/
Feel free to file an issue though, the decision was not a "no" but rather a "not now".



来源:https://stackoverflow.com/questions/15248844/how-to-deserialize-bigdecimal-by-using-gwt-autobean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!