Here is SpringMVC Controller code snippet:
@RequestMapping(value = \"/getCityList\", method = RequestMethod.POST)
public @ResponseBody LinkedHashMap
You're expecting a JSON object's entries to have the same order as the LinkedHashMap entries. That won't happen, because JavaScript object keys have no intrinsic order. They're just like Java HashMaps.
If you need a JavaScript data structure that maintains an order, you should use an array, not an object. Return a sorted List
from your method, where City
has a key and a value.