2 回答

TA贡献1876条经验 获得超5个赞
java to javascript:
map.put("name", JSONNull.getInstance())
javascript to hava:
{name : undefined}
或者不传name。

TA贡献1877条经验 获得超6个赞
private static void each(Map m){
Iterator it = m.entrySet().iterator();
while (it.hasNext()) {
Map.Entry entry = (Entry) it.next();
Object value = entry.getValue();
if(value == null) continue;
if(value instanceof List){
System.err.println(1);
Iterator lit = ((JSONArray) value).iterator();
while (lit.hasNext()) {
Object lvalue = lit.next();
each((Map) lvalue);
}
}else if(value instanceof Map){
each((Map) value);
}else if ((value instanceof net.sf.json.JSONNull)){
entry.setValue(null);
}
}
}
添加回答
举报