Exemple #1
0
  @Override
  protected void execute() throws ServletException, IOException {
    ClassService classService = new ClassService();

    JsonArray jsonArray = new JsonArray();

    List list = (List) session.getAttribute("list");
    if (list != null) {
      if (list.size() > 12) {
        // list = null;
        // list = new ArrayList();
        list.remove(0);
      }

    } else {
      list = new ArrayList();
    }
    list.add(classService.getJson());
    session.setAttribute("list", list);

    for (Object object : list) {
      jsonArray.add((JsonObject) object);
    }
    printJson(jsonArray.toString());
  }
Exemple #2
0
 public void getclass() {
   ClassService classService = new ClassService();
   printJson(classService.getString());
 }