将JSON对象写入响应对象的输出流。您还应该按如下方式设置内容类型,该类型将指定您要返回的内容:response.setContentType("application/json");// Get the printwriter object from response to write the required json object to the output stream PrintWriter out = response.getWriter();// Assuming your json object is **jsonObject**, perform the following, it will return your json object out.print(jsonObject);out.flush();