EDIT Maybe this is better explanation (sorry, I know javascript better than English... and I don't know very well javascript :-)
I need to map a complex javascript object sent with jquery $.ajax in a java bean by my servlet.
This is a real example done with jQuery and sniffed with Firebug. This is the js code:
$("#test").click(function(){
$.ajax({
url: "/server",
data: { "data1": [{key:1, val:2},{key:3, val:4}] },
type: "post",
}
});
});
As you can see I'm sending a complex object inside $.ajax data, not a simple map. If I check how the http request is sent with firebug sniffer i get this POST params:
Parameters application/x-www-form-urlencoded
data1[0][key] 1
data1[0][val] 2
data1[1][key] 3
data1[1][val] 4
This is how jquery convert a complex object into a simple map. I would like to get this object in a java bean. Thanks.
EDIT2 This: Java convert JSONObject to URL parameter seems to be exactly the opposite of my demand. But it has no answer...