GWT:JSON在客户端和服务器端使用相同的API解析 [英] GWT : JSON Parsing in client side and server side with same api
本文介绍了GWT:JSON在客户端和服务器端使用相同的API解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们使用org.json api解析服务器端的json,并使用GWT JsonParser解析客户端的JSON。有没有我们可以用在客户端和服务器端的api?
We use org.json api to parse json on server side and GWT JsonParser to parse JSON on client side. Is there a api that we can use that can be used on both the client side and server side?
推荐答案
您正在寻找GWT AutoBean: http://code.google.com/p/google-web-toolkit/wiki/AutoBean
You are looking for GWT AutoBean: http://code.google.com/p/google-web-toolkit/wiki/AutoBean
使用AutoBeans,juset定义JSON的结构,GWT编译器处理其余部分。
With AutoBeans you juset define the structure of your JSON and the GWT Compiler handles the rest.
这篇关于GWT:JSON在客户端和服务器端使用相同的API解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文