JSON转String String s = JSONObject.toJSONString(object);String s1 = new ObjectMapper().writeValueAsString(object);net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(object);