public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/html;charset=gbk");
		PrintWriter out = response.getWriter();
		String user="";
		user=request.getParameter("username");
		user=user==null?null:new String(user.getBytes("ISO-8859-1"),"gbk");
		String passWord="";
		passWord=request.getParameter("password");
		List<US> users=USOperation.select();
		int n=0;
		for (int i = 0; i < users.size(); i++) {
			if(user.equals(users.get(i).getUserName())&&passWord.equals(users.get(i).getPassWord())){
				HttpSession session=request.getSession(true);
				session.setAttribute("username", user);
				session.setAttribute("password",passWord );
				RequestDispatcher view =request.getRequestDispatcher("main.jsp");
				view.forward(request, response);
				break;
			}
			else{
				n++;	
			}		
		}

		if(n==users.size()){
//			response.sendRedirect("DisplayError.jsp");
			out.println("<script type=\"text/javascript\">");
			out.println("alert(\"½ʧܣµ½\");");
			out.println("open(\"index.jsp\",\"_self\");");
			out.println("</script>");
			
		}
	
		out.flush();
		out.close();
	}