你是用什么转换的?fastjson就可以啊
User u = new User();
u.setUrl(null);
u.setUserName("孟宪会");
System.out.println(com.alibaba.fastjson.JSON.toJSONString(u));
User u = new User();
u.setUrl(null);
u.setUserName("孟宪会");
System.out.println(com.alibaba.fastjson.JSON.toJSONString(u));
alert(a.name);
delete a.name;
alert(a.name);
并不表示 name 无用,只不过 name 的值为空通常,访问一个不存在的变量时,是要报错的
所以空值属性是应该存在的