Getting multiple-value parameter passed via a jQuery ajax POST, in JSP
In another question, the following code was offered as a way to send a list of checkboxes via ajax POST:
var data = { 'user_ids[]' : []};
$(":checked").each(function() {
data['user_ids[]'].push($(this).val());
});
$.post("ajax.php", data);
I have a JSP page in which I would like to parse the value data in data
. What format开发者_运维问答 would the data be in (i.e. string or array)? How can I parse it?
Thanks!
- you don't need
[]
- you can obtain the values by
request.getParameterValues("user_ids")
精彩评论