@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		String login = req.getParameter("login");
		String pass = req.getParameter("password");

		User user = userDao.getUserByLogin(login);
		
		if (pass.equals(user.getPass()) && (user.getAccess() == 0)) {
			HttpSession session = req.getSession();
			session.setAttribute("login", login);
			goToPage("/librarian.jsp", req, resp);
		} else if (pass.equals(user.getPass()) && (user.getAccess() == 1)) {
			HttpSession session = req.getSession();
			session.setAttribute("login", login);
			goToPage("/user.jsp", req, resp);
		} else {
			req.setAttribute("note", "There is no such Login or Password!");
			logger.error("not authorized access!");
			goToPage("/index.jsp", req, resp);
		}
	}