SpringMVC向前台返回JSON

JSONArray json = JSONArray.fromObject(childNode.toArray());
        String s = json.toString();
        response.setContentType("text/json; charset=UTF-8");
        response.setCharacterEncoding("UTF-8");
        try {
            response.getWriter().write(s);
        } catch (IOException e) {
            e.printStackTrace();
        }


你可能感兴趣的:(json,springMVC)