Fórum

Order problem with Liferay JSON object

thumbnail
Juhi Kumari, modificado 9 Anos atrás.

Order problem with Liferay JSON object

Expert Postagens: 347 Data de Entrada: 12/12/11 Postagens Recentes
Hi,

Using Liferay JSON object I am sending my data from java to jsp. Due to some restriction I cant use JavaScript/JQuery so using jsp's
scriptlet tag iterating the data in jsp. Data is displaying but not in the same order in which I sent from my java class. How to acheive
the same order??
If have any idea please share!!


Regards,
Juhi
thumbnail
shailendr Singh, modificado 9 Anos atrás.

RE: Order problem with Liferay JSON object

New Member Postagens: 4 Data de Entrada: 04/07/14 Postagens Recentes
You cannot and should not rely on the ordering of elements within a JSON object.
"An object is an unordered set of name/value pairs "
As a consequence, JSON libraries are free to rearrange the order of the elements as they see fit.

for more information http://www.json.org/