@RequestMapping(value = "/userinfo/{userId}", method = RequestMethod.GET) @ResponseBody public String GetUser(@PathVariable("userId") int userId) throws IOException { RiashUser riashUser = riashUserService.getById(userId); // String retVal = JSONObject.toJSON(riashUser).toString(); // System.out.printf(retVal); // response.getWriter.write(JSONObject.fromObject(user).toString()); return JSONObject.toJSONString(riashUser); // return userList; }
2021-04-19 把对象实现转换成jason格式 返回方法
最新推荐文章于 2022-08-27 12:06:04 发布