When I declare a map and put a null value like below:
Map map =new HashMap(); map.put("nullval",null); JSONObject o =JSONObject.fromObject(map); System.out.println(o.toString(0));
i get a json {"nullval":null}
But I want to get {"nullval":""}
I tried to registerJsonValueProcessor(Object.class,...) but none of use;
Thanks a lot!
I forget to say I use jdk1.4
Log in to post a comment.
When I declare a map and put a null value like below:
Map map =new HashMap();
map.put("nullval",null);
JSONObject o =JSONObject.fromObject(map);
System.out.println(o.toString(0));
i get a json {"nullval":null}
But I want to get {"nullval":""}
I tried to registerJsonValueProcessor(Object.class,...) but none of use;
Thanks a lot!
I forget to say I use jdk1.4