@Override protected Navigation run() throws Exception { // TODO Auto-generated method stub /*UserService service = new UserService(); service.removeUserModel(um.getKey()); return redirect("/");*/ UserService service = new UserService(); JSONObject json = new JSONObject(); UserDto user = new UserDto(); try { json = new JSONObject((String) this.requestScope("data")); user.setAddress(json.getString("address")); user.setAge(json.getInt("age")); // user.setBirthday(Date.parse(json.getString("date")); user.setEmail(json.getString("email")); // user.setKey(null); // user.setImgSrc(json.getString("imgSrc")); user.setName(json.getString("name")); service.removeUserModel(user); } catch (Exception e) { e.printStackTrace(); user.getErrorList().add("Server controller error: " + e.getMessage()); } json.put("user", user.toJSON()); json.put("errorList", user.getErrorList()); response.setContentType("application/json"); response.getWriter().write(json.toString()); return null; }