protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		HttpSession session = request.getSession(true);
		String uname = request.getParameter("username").replaceAll("\\s","");
		String pwd = request.getParameter("password").replaceAll("\\s","");
		String email = request.getParameter("email").replaceAll("\\s","");
		if(uname != null && pwd != null && pwd != null && htmlFilter(uname.trim()).length() != 0 && htmlFilter(pwd.trim()).length() != 0 &&  htmlFilter(email.trim()).length() != 0){
			if(registerUser(uname,pwd,email)){
				session.setAttribute("uname", uname);
				request.setAttribute("msg","Successfully Logged In");
				request.getRequestDispatcher("main.jsp").forward(request, response);
			}else{
				request.setAttribute("msg","Username Taken or Other Error Verified");
	            request.getRequestDispatcher("register.jsp").forward(request, response);
			}
		}else{
			request.setAttribute("msg","Please fill in all the fields");
            request.getRequestDispatcher("register.jsp").forward(request, response);
		}
	}