GWT数据序列化

编程入门 行业动态 更新时间:2024-10-11 09:23:54
本文介绍了GWT数据序列化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在寻找Google的Web Toolkit用于在AJAX请求期间序列化发布到服务器的数据的算法。我希望以另一种语言复制它,这样我就可以将我的另一个项目与GWT项目联系在一起。

I'm looking for the algorithm that Google's Web Toolkit uses to serialize data posted to the server during an AJAX request. I'm looking to duplicate it in another language so that I can tie in another of my projects with a GWT project.

任何帮助都非常感谢!

推荐答案

GWT-RPC序列化与Java密切相关。它甚至通过线路发送Java类名。

The GWT-RPC serialization is heavily tied to Java. It even sends Java class names over the wire.

我建议你使用类似JSON的东西与服务器进行通信。这样,您可以在GWT服务器上使用任何编程语言。

I suggest you use something like JSON to communicate with the server. This way, you can use any programming language with the GWT server.

更新:有没有对GWT-RPC格式的明确引用,并且邮件列表发布解释了这个决定:

Update: There are no definitive references to the GWT-RPC format, and a mailing list post explains that decision:

GWT RPC格式是故意不透明的JSON。这使得它之间的困难和不可能将非GWT代理添加到 RPC讨论中。对于来说,创建非Java服务器端实现并不是一个很好的解决方法,但是,因为您的 RemoteServiceServlet实现只需实现您的同步RPC接口,所以很可能对于非GWT客户端而言,与同一个服务器端业务逻辑交谈,而不使用 RPC协议。

The GWT RPC format is intentionally opaque JSON. This makes it somewhere between difficult and impossible to add a non-GWT agent to the RPC discussion. There isn't really a nice work-around for creating a non-Java server-side implementation but, because your RemoteServiceServlet implementation just has to implement your synchronous RPC interface, it's quite possible for non-GWT clients to talk to the same server-side business logic, just without using the RPC protocol.

以及出现的小细节

and the little detail which surfaced was

格式是纯文本格式。它实际上是JSON。这只是不可读的JSON,因为假设是生产函数和消费代码都是自动生成的,并且可以对文本的结构做出各种假设。

The wire format is plain text. It's actually JSON. It's just unreadable JSON because the assumption is that both the producing and consuming code is auto-generated and can make all kinds of assumptions about the structure of the text.

更多推荐

GWT数据序列化

本文发布于:2023-11-12 13:11:40,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:序列化   数据   GWT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!