i have in javascript
var data = new Object();
and some attributes for this object are:
data.name = "mike";
data.id = 1;
i use jquery to pass the object to a jsp page
var request = $.ajax
({
url: "test.jsp",
type: "post",
data: 'obj='+ data,
success: function(msg) {
$('#response').html(msg);},
error:function (xhr, ajaxOptions, thrownError){
alert(xhr.status);
alert(thrownError);
}
});
in the jsp i say
Object objParam = request.getParameter("obj");
out.println(objParam.name);
this doesn't seem to work. please help.