1、
JSONObject json = new JSONObject(); json.put("list", "test"); msg=json.toString(); JsonConfig jsonConfig = new JsonConfig(); //建立配置文件 jsonConfig.setIgnoreDefaultExcludes(false); //设置默认忽略 jsonConfig.setExcludes(new String[]{"jobs"}); //此处是亮点,只要将所需忽略字段加到数组中即可 msg = JSONSerializer.toJSON(selWebSite, jsonConfig).toString();
原文:http://www.cnblogs.com/chasewade/p/3578557.html