前端代码
function insert_student(){
var select = new Array();
var text = $(" .have_input ");
//console.log( $("text["+z+"] : input"));
for(var i= 0; i<text.length; i++){
if($($(" .have_input ")[i].children[0]).prop("checked") == true){
//console.log(i);
select.push($(" .have_input ")[i].nextSibling.innerHTML);
//select.push($("trrr[i] td:eq(1)").innerHTML);
}
}
console.log(select);
$.getJSON("insertStudentSvl",
{"students":select},
function (result){
}
)
}
后端代码
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
response.setContentType("text/html; charset=UTF-8");
String a= request.getParameter("students");
PrintWriter out = response.getWriter();
StudentDao dao= new StudentDao();
//ArrayList<StudentEntity> students= new ArrayList<StudentEntity>();
System.out.println(a);
select数组中的每个元素都是一个字符串,我想知道后端怎么处理能得到该值,感谢!