@Override
    public void execute(HttpServletRequest request, HttpServletResponse response) throws DaoException, CommandException, ServletException, IOException {

        String login = request.getParameter("login");
        String password = request.getParameter("password");
        IPersonDAO personDAO = DAOFacade.getPersonDAO();
        AbstractPerson person;
     //   try {
            person = personDAO.get(login, password);
//            if (person == null) {
//                throw new CommandException("No such person");
//            }
            if (person instanceof Administrator) {
                Administrator admin = (Administrator) person;
                request.getSession().setAttribute("person", admin);
                CommandFactory.getPageCommand("adminPanel").execute(request, response);
            } else if (person instanceof Client) {
                Client client = (Client) person;
                request.getSession().setAttribute("person", client);
                CommandFactory.getPageCommand("clientPanel").execute(request, response);
            } else {
                request.setAttribute("loginError", "error");
                CommandFactory.getPageCommand("autorization").execute(request, response);
            }
       }