第1个回答 推荐于2016-01-20
import org.json.JSONArray;
import org.json.JSONObject;
public void outJson(Object obj) throws Exception {
JSONObject json = new JSONObject(obj, false);
String rr = json.toString(1);
response.setCharacterEncoding("utf-8");
response.getOutputStream().write(rr.getBytes("utf-8"));
}本回答被提问者和网友采纳