ActionErrors actionErrors = new ActionErrors(); actionErrors.add("error", new ActionError("error.no.execution.period")); saveErrors(request, actionErrors);
ActionMessages actionMessages = new ActionMessages(); actionMessages.add("", new ActionMessage("error.no.execution.period")); saveMessages(request, actionMessages);
    public ActionForward listSummariesControl(ActionMapping mapping, ActionForm actionForm,            HttpServletRequest request, HttpServletResponse response) throws Exception {        DynaActionForm dynaActionForm = (DynaActionForm) actionForm;        String departmentID = (String) dynaActionForm.get("department");        String executionPeriodID = (String) dynaActionForm.get("executionPeriod");        boolean runProcess = true;        if (departmentID == null || departmentID.equals("")) {            ActionErrors actionErrors = new ActionErrors();            actionErrors.add("error", new ActionError("error.no.deparment"));            saveErrors(request, actionErrors);            dynaActionForm.set("executionPeriod", "");            runProcess = false;        }        if (executionPeriodID == null || executionPeriodID.equals("")) {            ActionErrors actionErrors = new ActionErrors();            actionErrors.add("error", new ActionError("error.no.execution.period"));            saveErrors(request, actionErrors);            runProcess = false;        }        if (runProcess) {            getListing(request, departmentID, executionPeriodID);            if (request.getParameter("sorted") == null) {                request.setAttribute(LifeCycleConstants.VIEWSTATE_PARAM_NAME, null);            }        }        readAndSaveAllDepartments(request);        readAndSaveAllExecutionPeriods(request);        return mapping.findForward("success");    }