@RequestMapping(method = POST, value = "/{name}/deposit") public ModelAndView depositAmount(@PathVariable String name, @RequestParam String amount) { accountService.depositAmount(name, Long.parseLong(amount)); long balance = accountService.getBalance(name); return new ModelAndView( "redirect:/accounts/" + name, "account", new AccountView(name, balance, "")); }