I have a javascript array on the frontend that I need to send to my Tomcat server.
Currently, I am using the following code but encountering issues:
console.log("preview list. postUsers()");
console.log(Ext.getCmp("preview-container").getUsers());
$.ajax({
url: "url",
type: "POST",
data: Ext.getCmp("preview-container").getUsers(),
dataType: "json",
success: function(rst){
switch (rst){
case true:
alert("success");
break;
case false:
alert("failed");
break;
}
},
});
The object looks like this:
preview list. postUsers()
["18241", "44598", "46558"]
However, the result of the POST request is:
undefined=undefined&undefined=undefined&undefined=undefined&...
This result is being interpreted as:
undefined: undefined ...
Is there something crucial that I may be missing?