开发者

Using JSON vs XML for transporting Data to server side (J2EE)

开发者 https://www.devze.com 2023-03-30 14:28 出处:网络
the bel开发者_如何学编程ow line is taken from a website **JSON Objects are serializable and where as XML is not .**

the bel开发者_如何学编程ow line is taken from a website

**JSON Objects are serializable and where as XML is not .**

Assume that i am passing a JSON Object from UI to the server (J2EE Language)\ Could you please tell me in what way will it effect if i use XML or JSON for transporting the data from a HTML/JSP to the server ??

Thank you very much .


transportation of JSON over network between client and server is more lean and lightweight.

For example, to transport a simple Animal object over the network in XML may look something like this:

<Animal>
<Name>Lion</Name>
<Sex>Male</Sex>
</Animal>

In JSON, it would look something like this:

{Animal: {Name: "Lion", Sex: "Male"}}

Due to the data structure of JSON, interpreters parse JSON string faster than XML string.

0

精彩评论

暂无评论...
验证码 换一张
取 消