var res=xmlhttp.getElementsByTagName("res")[0].firstChild.data;
servletresponse.setContentType("text/xml; charset=gb2312");
response.setHeader("Cache-Control", "no-cache");
response.setCharacterEncoding("gb2312");
request.setCharacterEncoding("gb2312");

    String username=new String(request.getParameter("username").getBytes("ISO-8859-1"),"gb2312");
String password=new String(request.getParameter("password").getBytes("ISO-8859-1"),"GB2312");
    HttpSession session = request.getSession();
    PrintWriter out = response.getWriter();
    out.println("<response>");
SqlConn db = new SqlConn();
String sql="select * from T_user where user_loginname='"+username+"'";// and user_password='"+password+"'";
ResultSet rs=db.executeQuery(sql);
try{
if(rs.next()){
if(password.equals(rs.getString("user_password"))){
session.setAttribute("username", rs.getString("user_realname"));
out.println("<res>" + "1" + "</res>");
}else {
out.println("<res>" + "0" + "</res>");
}
}else {
out.println("<res>" + "-1" + "</res>");
}
}catch(Exception e){
e.printStackTrace();
}
out.println("</response>");
out.close();为什么 var res=xmlhttp.getElementsByTagName("res")[0].firstChild.data;这行代码报“对象不支持此属性或方法”