var password = document.getElementById("oldPassword").value;
xmlhttp.open("GET", "servlet/StudentInterfaceServlet?type=update& oldPassword=y"+password, true);
xmlhttp.open("GET", "servlet/StudentInterfaceServlet?type=update& oldPassword=y"+password, true);
xmlhttp.send();
要想把变量中的值传送到servlet中需要这样写。
如果有两个变量参数
例子:var username = ${student.id };
var password = document.getElementById("oldPassword").value;
xmlhttp.open("GET", "servlet/StudentInterfaceServlet?type=update&oldPassword="+password+"&username="+username, true);
xmlhttp.send();