@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		response.setContentType("application/json; charset=UTF-8");
		String method = request.getParameter("method");
		if("list".equals(method)){
			this.list(request, response);
		}else if("add".equals(method) || "update".equals(method)){
			String id = request.getParameter("id");
			String code = request.getParameter("code");
			String name = request.getParameter("name");
			String sex = request.getParameter("sex");
			String birthday = request.getParameter("birthday");
			String origin = request.getParameter("origin");
			String dept = request.getParameter("dept");
			
			student = new Student();
			student.setCode(code);
			student.setName(name);
			student.setSex(Integer.parseInt(sex));
			student.setBirthday(birthday);
			student.setOrigin(origin);
			student.setDept(dept);
			
			if("add".equals(method)){
				this.add(request, response);
			}else if("update".equals(method)){
				student.setId(Integer.parseInt(id));
				this.update(request, response);
			}
			response.getWriter().write("{success:true,msg:'保存成功'}");
		}else if("delete".equals(method)){
			this.delete(request, response);
		}
	}