servlet怎么传数据给ajax

2025-03-10 16:03:44
推荐回答(1个)
回答1:

PrintWriter out =null; try { out = response.getWriter(); String jsonData=“-----”; out.print(jsonData); } catch (Exception e) { e.printStackTrace(); }finally{ if (out!=null) { out.flush(); out.close(); } }