Esempio n. 1
0
  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";
  }
Esempio n. 2
0
  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";
  }