把list打成JSSON数组

TreeBiz tb = new TreeBiz();
   List<Tree> list = tb.selAll();
   JSONArray json = JSONArray.fromObject(list);
   request.setAttribute("json",json);
   request.getRequestDispatcher("index2.jsp").forward(request, response);

传到下一个页面

var     zJONE  =  s{json};
  

原文地址:https://www.cnblogs.com/wangchao422/p/9569704.html