详细查看:http://www.cnblogs.com/tingbogiu/p/5796199.html
关键点:
1、返回值类型为void
2、得到响应字符流
PrintWriter printWriter = response.getWriter();
3、向字节流写入json字符串
printWriter.print(data);
4、刷新关闭字节流
printWriter.flush(); printWriter.close();
详细查看:http://www.cnblogs.com/tingbogiu/p/5796199.html
关键点:
1、返回值类型为void
2、得到响应字符流
PrintWriter printWriter = response.getWriter();
3、向字节流写入json字符串
printWriter.print(data);
4、刷新关闭字节流
printWriter.flush(); printWriter.close();