11月11日总结

词云

在传数据的时候有很大的波折,因为layui要限制json数据的格式,然后echarts也要限制json的格式,整了好半天才把格式调教好

 protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
resp.setCharacterEncoding("utf-8");
String tempStr = req.getParameter("temp");
System.out.println(tempStr);
int temp = Integer.parseInt(tempStr);
// System.out.println("ajax传值成功");
// String data1="{\"code\":0,\"msg\":\"\",\"count\":1000,\"data\":";
PrintWriter out = resp.getWriter();
// out.print(data1+ DaoUtil.getcount(temp)+"}");
// System.out.println("提取值成功"+temp);
String json = DaoUtil.getcount(temp);
json = json.replaceAll("keyword", "name");
json = json.replaceAll("count", "value");
out.print(json);

out.flush();
out.close();
}
posted @ 2021-11-11 20:32  不详·Christina  阅读(28)  评论(0编辑  收藏  举报