	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws IOException, ServletException {
		if (!checkCsrf(req, resp))
			return;
		Map<String, Exception> errors = new LoginValidator().validate(req);
		if (!errors.isEmpty()) {
			showError(req, resp, errors);
			return;
		}
		final String id = req.getParameter("id").trim();
		final String password = req.getParameter("password").trim();
		Boolean isCorrectPassword = false;
		try {
			isCorrectPassword = Member.isCorrectPassword(id, password);
		} catch (DBAccessException e) {
			errors.put("DBAccess", e);
		}
		if (!isCorrectPassword)
			errors.put("Login", new Exception("ID���p�X���[�h���قȂ�܂��B"));
		if (!errors.isEmpty()) {
			showError(req, resp, errors);
			return;
		}
		HttpSession session = new SessionRepository().getSession(req, true);
		session.setAttribute("memberId", id);
		resp.sendRedirect("/");
	}

	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws IOException, ServletException {
		if (!checkCsrf(req, resp))
			return;
		Map<String, Exception> errors = new LoginValidator().validate(req);
		if (!errors.isEmpty()) {
			showError(req, resp, errors);
			return;
		}
		final String id = req.getParameter("id").trim();
		final String password = req.getParameter("password").trim();
		Boolean isCorrectPassword = false;
		try {
			isCorrectPassword = Member.isCorrectPassword(id, password);
		} catch (DBAccessException e) {
			errors.put("DBAccess", e);
		}
		if (!isCorrectPassword)
			errors.put("Login", new Exception("IDかパスワードが異なります。"));
		if (!errors.isEmpty()) {
			showError(req, resp, errors);
			return;
		}
		HttpSession session = new SessionRepository().getSession(req, true);
		session.setAttribute("memberId", id);
		resp.sendRedirect("/");
	}
