其实挺小的一个细节,总算稀里糊涂做出来。
废话不多说了。
@Path("/alter")
@POST
@Produces("application/json")
public Response alter(String jsonStr){
//System.out.println(jsonStr);
JSONObject json = JSONObject.fromObject(jsonStr);
System.out.println(json);
User user = (User)JSONObject.toBean(json,User.class);
System.out.println(user.getNickName());
return Response.status(200).entity(jsonStr).build();
}@P