use of com.zyf.dao.Info24Dao in project HeartWatchdogJsp by Viczyf.
the class Info24Servlet method select_con_list.
public void select_con_list(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Info24Dao info24Dao = new Info24Dao();
HttpSession session = request.getSession();
User user = (User) session.getAttribute("user");
int uid = user.getUid();
// List infoList = info24Dao.queryInfo24(uid);
// JsonArray array = new JsonArray();
int id = MyTools.strToint(request.getParameter("id"));
Info24 single = info24Dao.queryInfoSingle(id, uid);
JsonObject ob = new JsonObject();
String conclusion = "";
String addr = single.getConclusionaddr();
String file = request.getSession().getServletContext().getRealPath("/") + "24holter/conclusion/" + addr;
try {
BufferedReader rd = new BufferedReader(new FileReader(file));
String s = rd.readLine();
while (null != s) {
conclusion += s;
s = rd.readLine();
}
rd.close();
// System.out.println(str);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
conclusion = "[" + conclusion + "]";
ob.addProperty("con", conclusion);
// array.add(ob);
PrintWriter out = response.getWriter();
out.print(ob);
out.flush();
out.close();
}
Aggregations