@RequestMapping(method = RequestMethod.GET)
  public String displayForm(HttpServletRequest request, Model uiModel) {
    try {
      User account = (User) request.getSession(true).getAttribute("user");
      User user = accountManager.findByLogin(account.getLogin());
      uiModel.addAttribute("user", user);
    } catch (AccountNotFoundException e) {
      logger.error(e.getMessage());
      return "redirect:/signin";
    }

    return "profile/profileForm";
  }
  @RequestMapping(method = RequestMethod.POST)
  public String displayForm(
      HttpServletRequest request, @ModelAttribute(value = "user") User user, BindingResult result) {

    if (result.hasErrors()) return "profile/profileForm";

    User account = (User) request.getSession(true).getAttribute("user");
    user.setLogin(account.getLogin());

    try {
      accountManager.updateInfo(user);
    } catch (AccountNotExistException e) {
      logger.error(e.getMessage());
      return "404";
    } catch (InvalidEmailException e) {
      logger.error(e.getMessage());
      return "404";
    }

    return "profile/profileForm";
  }