日期:2014-05-16 浏览次数:20721 次
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
response.setContentType("text/html");
UserDao ud=new UserDao();
String username=request.getParameter("user");
String userpassword=request.getParameter("pwd");
boolean flag=ud.sel(username);
System.out.println(username);
System.out.println(userpassword);
System.out.println(flag);
PrintWriter out = response.getWriter();
if(flag){
out.print("The user name has been registered!");
}else{
out.print("<script>window.location.href='login.jsp';</script>");
//response.sendRedirect("login.jsp");
}
}
// out.print("<script>window.location.href='login.jsp';</script>");
out.print("1");
if(ajaxobj.responseText=='1')window.location='login.jsp'