我正在使用 json 简单库编写 json 数据 here
现在代码运行良好并且我能够获得输出。代码是-
<%@page contentType="application/json" pageEncoding="UTF-8"
import="org.json.simple.JSONObject"%>
<%
JSONObject json = new JSONObject();
newa.NewClass1 newca = new newa.NewClass1();
try {
String s_id = session.getAttribute("id").toString();
json.put("count", newca.get_update_count(s_id) );
} catch (Exception e) { json.put("count", "0" ); }
out.println(json);
json.clear();
out.flush();
out.close();
%>
现在每次我点击页面时,我都会在服务器日志中收到警告 -
WARNING: Internal error flushing the buffer in release()
我如何在代码中使用 out.flush 来刷新缓冲区。
问候
最佳答案
我相信“out.close()”可能会导致您的问题。您不需要显式关闭()输出流,因此请尝试将其删除。我认为一旦执行了 JSP,就会发生隐式 flush() 和 close(),并且通过发出显式 close() 会导致下游 flush() 中断。
关于jsp - 写入自定义输出时刷新 jsp 中 release() 中的缓冲区的内部错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24801837/