Пример #1
0
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    HttpSession session = request.getSession();
    ErrorKeeper errorKeeper = (ErrorKeeper) session.getAttribute(Constants.ERROR_KEY);
    String errorMsg = errorKeeper != null ? errorKeeper.getErrorMsg() : "";

    if (errorMsg == null) {
      errorMsg = "";
    }

    DataKeeper dkeeper = (DataKeeper) session.getAttribute(Constants.DATA_KEY);
    if (dkeeper == null) {
      dkeeper = new DataKeeper();
    }
    String numTasks = Integer.toString(dkeeper.getListSize());

    ((DynaActionForm) form).set("userList", dkeeper.getList());
    ((DynaActionForm) form).set("numTasks", numTasks);
    ((DynaActionForm) form).set("errorMsg", errorMsg);

    return mapping.findForward(Constants.SUCCESS_KEY);
  }