I am using a servlet that returns a JSONArray of JSONObjects via URL:
http://myserver.corp:8080/webtools/myServlet?targetDB=myTargetDB&sqlStatement=myStatement¶m0=abc
Output:
[
{
"attribute1": "value1",
"attribute2": "value2",
"attribute3": "value3",
"attribute4": "value4",
}
]
Now this works like a charm, until I discovered that the order attributes varies depending on the environment I launch it in.
When I am launching the program in Eclipse, I get the above result - but when launching the program as a runnable JAR, the order is reversed (attribute4 to attribute1).
Now I understand that JSONObjects are not ordered. But there must be a reason why the order of the attributes in the JSONObjects is reversed.
Does anyone have an idea ?
Cheers, Tim