Using JSON vs XML for transporting Data to server side (J2EE)
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.
精彩评论