"PatientInfo": {
"Name": "{\"GivenName\":\"sduie\"}",
"Height": "",
"Weight": "身高170",
"age": "",
"Sex": -1,
"PatientID": ""
}
如上圖
"Name": "{\"GivenName\":\"sduie\"}"
利用org.json.JSONObject生成Json字符串有轉(zhuǎn)意字符
原因是
Paste_Image.png
換成
Paste_Image.png
···
private static JSONObject getObjectName(Name name) {
JSONObject nameObject = new JSONObject();
try {
nameObject.put("GivenName", name.getGivenName());
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println("===-BJ--nameObject===" + e);
}
System.out.println("===-BJ--nameObject===" + nameObject.toString());
return nameObject;
}
···
就好了。
還有注意下,利用阿里巴巴的fastjson生成json字符串時,會自動將首字母大寫的轉(zhuǎn)為小寫午衰。