public String testMagazineKoreaCulture(HttpServletRequest request, HttpServletResponse response) { System.out.println("in testMagazineKoreaCulture...."); MSObject obj = new MSObject(); List<MSBook> bookList = ts.getAllMSBooks(0, 0, "magazine_church"); obj.setCount(bookList.size()); obj.setBooks(bookList); obj.setLastDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); // String objStr = AjaxUtils.jsonString(obj); String objStr = getStringToJson(obj); System.out.println(objStr); try { response.getWriter().print(objStr); } catch (IOException e) { e.printStackTrace(); } return "3:ajax"; }
public String testHanatour(HttpServletRequest request, HttpServletResponse response) { System.out.println("in testHanatour...."); String code = request.getParameter("serialcode"); MSObject obj = new MSObject(); MSBook book = ts.getMSBooksBySerialCode(0, 0, "magazine_hanatour", code); List<MSBook> bookList = new ArrayList<MSBook>(); if (book != null) { bookList.add(book); } obj.setCount(bookList.size()); obj.setBooks(bookList); obj.setLastDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); // String objStr = AjaxUtils.jsonString(obj); String objStr = getStringToJson(obj); System.out.println(objStr); try { response.getWriter().print(objStr); } catch (IOException e) { e.printStackTrace(); } return "3:ajax"; }