public void register(HttpServletRequest request, HttpServletResponse response) {
		
		try{
			//request.setCharacterEncoding("UTF-8");
			//response.setCharacterEncoding("UTF-8");
		//JSPȡûϢ
		String name = new String(request.getParameter("username").getBytes("ISO-8859-1"),"UTF-8");
		String pass =request.getParameter("password");
		String realName =new String(request.getParameter("realname").getBytes("ISO-8859-1"),"UTF-8");
		String sex = new String(request.getParameter("gender").getBytes("ISO-8859-1"),"UTF-8");
		String ag = "0";
		int age;
		if(request.getParameter("age")==null){
			
			age = 0;
		}else{
			
			age = Integer.parseInt(request.getParameter("age"));
		}
		
		String email = new String(request.getParameter("email").getBytes("ISO-8859-1"),"UTF-8");
		String phone = request.getParameter("connectnumber");
		String address = new String(request.getParameter("address").getBytes("ISO-8859-1"),"UTF-8");
		
		//ϵͳлע
		Calendar cal = Calendar.getInstance();
		Date registerDate = new Date(cal.get(Calendar.YEAR) - 1900, cal.get(Calendar.MONTH), cal.get(Calendar.DATE));
		//ǿûΪû
		int role = 1;
		int id = 0;
		//ûϢװUSER
		User user = new User(id,name,pass,sex,age,role,realName,phone,email,address,registerDate);
		//UserDAOʵ
		UserDAO ud = new UserDAO();
		//жûǷ
			if((ud.querryUseName(name))==null){
				ud.insertUser(user);	
				response.sendRedirect("/BookShop/userView/registSuccess.jsp");
			}else{
				String alert ="ûѴ";
				if(pass == null){
					alert = "벻Ϊ";
					request.setAttribute("alert", alert);
				}
				//û,ûʾ,FORWARDעҳ
				
				request.setAttribute("alert", alert);
				request.getRequestDispatcher("../userView/register.jsp").forward(request, response);		
			}
		}catch(IOException e){
			e.printStackTrace();
		}catch(ServletException se){
			se.printStackTrace();
		}
	}