java - Sending Map<String,List<String>> as request parameter through ajax -
i want send map through ajax request getting 400 bad request. data like.
var idss1 = []; var idss2 = []; var idss3 = []; var idss4 = []; var idss5 = []; map[id_1] = idss1; map[id_2] = idss2; map[id_3] = idss3; map[id_4] = idss4; map[id_5] = idss5; wehre keys (id_*) string
ajax call
$.ajax({ type:"post", url: myurl, datatype: "text", data : {allids : map}, success: function(response) {...} at server side method signature
public void mymethod(httpservletrequest request, @requestparam("allids") map<string, list<string>> ids) { ... } kindly me, shall thankful.
1) should never have variables names in program difference number. arrays for. names of elements in array myarr[0], myarr[1], etc.
2) in java, can what's called 'serializing' object. serializing converts object string, , string can sent in ajax request, , string can unserialized in servlet create object string.
serialization string: how binary (de)serialize object into/form string?
Comments
Post a Comment