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

		request.setCharacterEncoding("UTF-8");
		String name = request.getParameter("name");
		String pwd = request.getParameter("pwd");
		String type = request.getParameter("type");
		// ҪһѡְԱʱû
		//if((name != null && !name.equals(""))&&(pwd != null && !pwd.equals("")))
		{
			if(name.equals("wdx")&&pwd.equals("wdx")&&type != null) // ʱӦҪȡжϣھд
			{
				// ¼ɹתѡҳ
				//request.getRequestDispatcher("functions.jsp").forward(request, response);
				// ȥ
				
				request.setAttribute("Name", name);
				request.setAttribute("Type", type);
				
				// ϢcookieУҳдֵ
				name = java.net.URLEncoder.encode(name, "UTF-8");
				type = java.net.URLEncoder.encode(type, "UTF-8");
				
				Cookie ck = new Cookie("name",name);
				Cookie ck1 = new Cookie("type", type);
				ck.setMaxAge(3600);
				ck1.setMaxAge(3600);
				response.addCookie(ck);
				response.addCookie(ck1);
				
				request.getRequestDispatcher("functions.jsp").forward(request, response);
			}
			else
			{
				//ֱضerror.jspʾ
				response.sendRedirect("error.jsp");
			}
		}
	}