第一步:将gson-1.7.1.jar包导入到您的WEB项目中
第二部:response.getWriter().print(new GsonBuilder().create().toJson(deptList));表示将deptList封装成JSON格式之后发送到前台
第一步:将gson-1.7.1.jar包导入到您的WEB项目中
第二部:response.getWriter().print(new GsonBuilder().create().toJson(deptList));表示将deptList封装成JSON格式之后发送到前台