/** * Update the email and the name for the user indentified by the passed id. */ @RequestMapping(value="/update") @ResponseBody public String updateName(long id, String email, String name) { try { User user = userDao.getById(id); user.setEmail(email); user.setName(name); userDao.update(user); } catch (Exception ex) { return "Error updating the user: " + ex.toString(); } return "User succesfully updated!"; }