服务器端
resp.getWriter().print(URLEncoder.encode(jsonArray.toString(),"utf-8"));
其中jsonArray.toString()是回传给客户端的json数据
客户端
JSONArray jsonArray = new JSONArray( URLDecoder.decode(s,"utf-8"));
其中s是来自服务器的数据
resp.getWriter().print(URLEncoder.encode(jsonArray.toString(),"utf-8"));
其中jsonArray.toString()是回传给客户端的json数据
JSONArray jsonArray = new JSONArray( URLDecoder.decode(s,"utf-8"));
其中s是来自服务器的数据