import com.google.gson.Gson;
//string转bean Gson gson = new Gson(); UserPage userPage = gson.fromJson(str, UserPage.class); List<UserVo> data = userPage.getData(); //加字段 userPage.setRecordsFiltered(data.size()); userPage.setRecordsTotal(data.size()); //bean转string String json = gson.toJson(userPage);