Package org.apache.struts.action

Examples of org.apache.struts.action.ActionMessage


      kbList.setCurrentCategoryID(categoryID);
      session.setAttribute("displaylist", kbList);
      request.setAttribute("displaylist", kbList);
    }catch(Exception e){
      System.out.println("[Exception][CV KBListHandler] Exception thrown in execute(): " + e);
      allErrors.add("error.unknownError", new ActionMessage("error.unknownError"));
    }

    if (! allErrors.isEmpty())
    {
      saveErrors(request, allErrors);
View Full Code Here


     
      boolean messageSent = emailSettingsRemote.simpleMessage(individualID,mailMessage);
     
      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] UpdateProfileHandler.Execute Handler ", e);
      allErrors.add("error.unknownError", new ActionMessage("error.unknownError"));
      forward = ".view.customer.profile";
    }

    if (! allErrors.isEmpty()) {
      // no point in saving errors to the request if there aren't any
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", "Folder ID"));
        return(mapping.findForward(forward));
      }
     
      MailHome home = (MailHome)CVUtility.getHomeObject("com.centraview.mail.MailHome", "Mail");
      Mail remote = (Mail)home.create();
View Full Code Here

      String fEmployee = (String) session.getAttribute("FromEmployee");

      if (request.getParameter(FileConstantKeys.TYPEOFOPERATION).equals(FileConstantKeys.EDIT)) {
        fileName = this.getFileInfo();
        if (fileName == null || fileName.trim().length() == 0) {
          errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "File Name"));
        }
      } else if (file != null) {
        fileName = file.getFileName();
        if (fileName == null || fileName.trim().length() == 0) {
          errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "File Name"));
        }
      } else {
        if (fEmployee != null && !fEmployee.equals("EmployeeHandbook")) {
          if (fileName == null || fileName.trim().length() == 0) {
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "File Name"));
          }
        }
      }

      if (fEmployee != null && !fEmployee.equals("EmployeeHandbook")) {
        if (this.getUploadfoldername() == null || this.getUploadfoldername().trim().length() == 0) {
          errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Folder Name"));
        }
      }

      // title
      if (this.getTitle() == null || this.getTitle().trim().length() == 0) {
        errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Title"));
      }

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

      // redirect to jsp if errors present
      if (!errors.isEmpty()) {
        request.setAttribute("bodycontent", "editdetailfile");
View Full Code Here

    ActionErrors errors = new ActionErrors();

    try {
      String tempTitle = this.getTitle();
      if (tempTitle == null || tempTitle.trim().length() <= 0) {
        errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Title"));
      }

      if (errors != null) {
        request.setAttribute("noteform", this);
      }
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);
    }
    return new ActionForward(request.getParameter("currentPage"), true);
 
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);
    }
    String returnPath = request.getParameter("currentPage");
    if(returnPath == null){
      returnPath = mapping.findForward(".view.hr.timesheet.list").getPath();
View Full Code Here

          String emailAddress = remote.getPrimaryEmailAddress(IndividualId, 2);
          if (emailAddress == null || emailAddress.equals("")) {
            allErrors
                .add(
                    ActionMessages.GLOBAL_MESSAGE,
                    new ActionMessage(
                        "error.freeForm",
                        "Error while sending email invitations. You do not have an email address configured. Please configure a primary email address in order to send email invitations."));
            saveErrors(request, allErrors);
            return (mapping.findForward(FORWARD_save));
          }
View Full Code Here

      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

    {
      // initialize validation
      Validation validation = new Validation()

      if (this.getFirstName() == null || this.getFirstName().trim().length() <= 0) {
        errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Name"));
      }
     
      if (this.getOldPassword() == null || this.getOldPassword().trim().length() <= 0) {
        errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Old Password"));
      }
     
      if (this.getNewPassword() == null || this.getNewPassword().trim().length() <= 0) {
        errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "New Password"));
      }
     
      if (this.getNewPassword() == null || this.getNewPassword().trim().length() <= 0) {
        errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Confirm Password"));
      }
     

      if (errors != null)
      {
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.