protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/html; charset=UTF-8");

		AccountManager manager = (AccountManager)this.getServletContext().getAttribute("manager");
		String username = request.getParameter("user");
		String password = request.getParameter("password");
		if (manager.passwordMatches(username, password)) {
			HttpSession session = request.getSession();
			User currentUser;
			try {
				currentUser = new User(username, (Statement) getServletContext().getAttribute("statement"));
				session.setAttribute("user", currentUser);
			} catch (SQLException e) {
				e.printStackTrace();
			}
			RequestDispatcher dispatch = request.getRequestDispatcher("home.jsp");
			dispatch.forward(request, response);
		}
		else {
			RequestDispatcher dispatch = request.getRequestDispatcher("login_fail.html");
			dispatch.forward(request, response);
		}
	}