Package org.apache.struts.action

Examples of org.apache.struts.action.ActionMessage


      throw new CommunicationException(e.getMessage());
    }
    if (!deleteLog.isEmpty())
    {
      ActionErrors allErrors = new ActionErrors();
      allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "You do not have permission to delete one or more of the records you selected."));
      session.setAttribute("listErrorMessage", allErrors);
    }
    ActionForward forward = new ActionForward(request.getParameter("currentPage"), true);
    return forward;
  }
View Full Code Here


      ValueListDisplay displayParameters = new ValueListDisplay(new ArrayList(), false, false, true, true, true, true);
      listObject.setDisplay(displayParameters);
      request.setAttribute("valueList", listObject);
    } catch (Exception e) {
      System.out.println("[Exception][CV UserListHandler] Exception thrown in execute(): " + e);
      allErrors.add("error.unknownError", new ActionMessage("error.unknownError"));
    }
    if (!allErrors.isEmpty()) {
      saveErrors(request, allErrors);
    }
    return (mapping.findForward(forward));
View Full Code Here

      logger.error("[execute] Exception thrown.", e);
      throw new CommunicationException(e.getMessage());
    }
    if (!deleteLog.isEmpty()) {
      ActionErrors allErrors = new ActionErrors();
      allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "You do not have permission to delete one or more of the records you selected."));
      session.setAttribute("listErrorMessage", allErrors);
    }
    ActionForward forward = null;
    if(request.getParameter("currentPage") != null){
      forward = new ActionForward(request.getParameter("currentPage"), true);
View Full Code Here

      boolean messageSent = false;
      try {
        messageSent = emailSettingsRemote.simpleMessage(individualID,mailMessage);
      } catch(Exception e) {
        allErrors.add("error.customer.profile.emailSendFailure", new ActionMessage("error.customer.profile.emailSendFailure"));
        saveErrors(request, allErrors);
        //return(mapping.findForward(".view.customer.view_user"));
        return(mapping.findForward(".view.customer.user_change_confirm"));
      }

      if (! messageSent) {
      // if email message is not sent, let the user know we suck
      allErrors.add("error.customer.profile.emailSendFailure", new ActionMessage("error.customer.profile.emailSendFailure"));
    }
    }catch(Exception e){
      // if an exception occurs, then print a message to the log file,
      // direct the user to the Customer Profile form, and show them
      // an error.
      logger.error("[Exception] UpdateUserHandler.Execute Handler ", e);
      allErrors.add("error.unknownError", new ActionMessage("error.unknownError"));
      forward = ".view.customer.view_user";
      e.printStackTrace();
    }

    if (! allErrors.isEmpty()) {
View Full Code Here

    displayList.setDataSource(dataSource);
    ArrayList deleteLog = displayList.deleteElement(individualID, rowId);//deletes the element
    displayList.setDirtyFlag(true);

    if(deleteLog != null && !deleteLog.isEmpty()){
      allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "You do not have permission to delete one or more of the records you selected."));
      session.setAttribute("listErrorMessage", allErrors);
    }

    request.setAttribute( "displaylist" , displayList);
    // If listFor is set on the request we must assume we came from the relatedInfo area
View Full Code Here

      if (request.getParameter("timeslip") != null) {
        if (request.getParameter("timeslip").equalsIgnoreCase("support")) {

          if ((String)get("description") == null
              || ((String)get("description")).trim().length() <= 0) {
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
                "error.general.requiredField", "Description"));
          }
        }
      } else {
        String project = (String)get("project");
        if (project != null && (!project.equals(""))) {

          if ((String)get("reference") == null || ((String)get("reference")).trim().length() <= 0) {
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
                "error.general.requiredField", "Reference"));
          }

          if ((String)get("task") == null || ((String)get("task")).trim().length() <= 0) {
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
                "error.general.requiredField", "Task"));
          }
        }

        if ((String)get("description") == null || ((String)get("description")).trim().length() <= 0) {
          errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
              "error.general.requiredField", "Description"));
        }
      }

      int startHrs = 0, startMins = 0, endHrs = 0, endMins = 0;

      if (((String)get("startTime")) != null && !(((String)get("startTime")).equals(""))) {
        int[] startTime = CVUtility.convertTimeTo24HrsFormat((String)get("startTime"));
        startHrs = startTime[0];
        startMins = startTime[1];
      }

      if (((String)get("endTime")) != null && !(((String)get("endTime")).equals(""))) {
        int[] endTime = CVUtility.convertTimeTo24HrsFormat((String)get("endTime"));
        endHrs = endTime[0];
        endMins = endTime[1];
      }

      if (startHrs > endHrs) {
        ActionMessage error = new ActionMessage("error.application.timecomparison", "EndTime",
            "StartTime");
        errors.add("error.application.timecomparison", error);
      } else if (startHrs == endHrs && startMins > endMins) {
        ActionMessage error = new ActionMessage("error.application.timecomparison", "EndTime",
            "StartTime");
        errors.add("error.application.timecomparison", error);
      }

      fBreakHrs = Float.parseFloat((String)get("breakHours"));
      fBreakMins = Float.parseFloat((String)get("breakMinutes"));
      fBreakTime = 0;

      if (fBreakMins != 0) {
        fBreakTime = fBreakHrs + fBreakMins / 60;
      } else {
        fBreakTime = fBreakHrs;
      }

      float remMin = 0;
      if (startMins != 0 && endMins != 0) {
        if (endMins > startMins) {
          remMin = 60 / (endMins - startMins);
        } else {
          remMin = 60 / (startMins - endMins);
        }
      }

      Float Duration = new Float((endHrs - startHrs) + remMin - fBreakTime);
      if (Duration.floatValue() <= 0.0) {
        ActionMessage error = new ActionMessage("error.projects.timeslip.totaltimediff",
            "Start and End Time difference", "BreakTime");
        errors.add("error.projects.timeslip.totaltimediff", error);
      }
    } catch (Exception e) {
      logger.error("[validate]: Exception", e);
View Full Code Here

      {
        request.setAttribute("closeWindow", "false");
        saveandclose = "";
        saveandnew = null;
        ActionErrors allErrors = new ActionErrors();
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "The Folder with This Name Already Exists On this Location"));
        saveErrors(request, allErrors);
      }
     
      if (saveandnew != null) {
        folderForm.setDescription("");
View Full Code Here

      ValueListDisplay displayParameters = new ValueListDisplay(new ArrayList(), false, false, true, true, true, true);
      listObject.setDisplay(displayParameters);
      request.setAttribute("valueList", listObject);
    } catch (Exception e) {
      logger.error("[execute] Exception thrown.", e);
      allErrors.add("error.unknownError", new ActionMessage("error.unknownError"));
    }
    if (!allErrors.isEmpty()) {
      saveErrors(request, allErrors);
    }
    return (mapping.findForward(forward));
View Full Code Here

        e.printStackTrace();
        request.setAttribute("closeWindow", "false");
        saveandclose = "";
        saveandnew = null;
        ActionErrors allErrors = new ActionErrors();
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "The Folder with This Name Already Exists On this Location"));
        saveErrors(request, allErrors);
        request.setAttribute("closeWindow","false");
      }

      if (saveandnew != null) {
View Full Code Here

      // now, check the folder ID on the form...
      if (folderID == null || folderID.intValue() <= 0) {
        // if folder ID is not set on the form, then there is
        // no point in continuing forward. Show user the door. :-)
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
            "error.general.requiredField", "Parent Folder ID"));
        return (mapping.findForward(forward));
      }

      String tableName = "cvfolder";
View Full Code Here

TOP

Related Classes of org.apache.struts.action.ActionMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.