@RequestMapping(method = RequestMethod.PUT) @ResponseBody public Map<String, String> updateUser(@RequestBody User user) { if (StringUtils.isEmpty(user.getUserId())) { Map<String, String> result = new HashMap<String, String>(); result.put("errorCode", "500"); result.put("errorMessage", "there is not userId in params to update user"); return result; } userService.updateUser(user); Map<String, String> result = new HashMap<String, String>(); result.put("result", "SUCCESS"); return result; }