/
/JSon字符串转JSon对象;使JSP页面直接返回JSON对象
//使用示例>> 在JSP代码里的最后一行加入 <% renderJson(response, json.toString()); %> 这段代码
public static String renderJson(HttpServletResponse response, String content){
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
response.setHeader("Cache-Control", "no-cache");
java.io.PrintWriter pw = null;
try{
pw = response.getWriter();
pw.write(content);
}catch (Exception e){
//
}finally{
pw.close();
}
return null;
}