Ajax pass a “Map” object to Spring MVC Controller
问题 It seems like Spring MVC doesn't know how to map a javascript "map" to a Java map object In the web UI, say, foo.jsp, <script> var myMap = {}; myMap["people"] = ["Alex","Bob","Charles","Dave"]; myMap["fruit"] = ["Apple","Orange"]; $.ajax({ type : "POST", url : "/myURL", data : "myMap=" + myMap, // I tried "myMap="+JSON.stringify(myMap), as well, it doesn't work neither success : function(response) { alert("Success! response = " + response); }, error : function(e) { alert("AJAX error"); } });