Package org.apache.struts.action

Examples of org.apache.struts.action.ActionMessage


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

      // invoice
      if (this.getOrderid() == null || this.getOrderid().trim().length() <= 0) {
        errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Order"));
      }
     
      if (this.getDate() == null || this.getDate().trim().length() <= 0) {
        errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Date"));
      }
     
      boolean itemPresent =false;
      int counter = 0;

      if (this.itemid != null)
      {
        ItemLines lines = this.getItemLines();

        for (int i=0;i<this.linestatus.length;i++)
        {
          if (this.linestatus[i] != null &&
              this.linestatus[i].equalsIgnoreCase("Deleted"))
          {
            counter++;
          }
        }



        if (this.itemid.length > 0 && this.linestatus.length != counter)
        {
          itemPresent = true;
        }
      }

      if (itemPresent == false)
      {
        errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requierdField", "Items"));
      }



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

     
      // now, check the account ID on the form...
      if (accountID == null || accountID.intValue() <= 0) {
        // if account 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", "Account ID"));
        return(mapping.findForward(forward));
      }

      MailHome home = (MailHome)CVUtility.getHomeObject("com.centraview.mail.MailHome", "Mail");
      Mail remote = (Mail)home.create();
View Full Code Here

          itemPresent = true;
        }
      }

      if (itemPresent == false) {
        ActionMessage error = new ActionMessage("error.application.required", messages
            .getMessage("error.account.expense.itemsrequired"));
        errors.add("error.application.required", error);
      }

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

        {
          uRemote.changePassword(individualId, oldPassword, newPassword);
        } catch (UserException ue) {
          if (ue.getExceptionId() == UserException.COULDNOT_CHANGE_PASSWORD)
          {
            allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm",
                "Error while updating login information, " + ue.getExceptionDescription()));
            saveErrors(request, allErrors);
          } else {
            ue.printStackTrace();
          }
View Full Code Here

      }
      catch(CvFileException e)
      {
        System.out.println("[Exception][SaveNewFileHandler.execute] Exception Thrown: "+e);
        ActionErrors allErrors = new ActionErrors();
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "File With This Name Already Exists in this path"));
        saveErrors(request, allErrors);
        request.setAttribute("closeWindow","false");
      }

      if (!(request.getParameter("closeornew").equals("close")) && (request.getAttribute("ExistFileError") == null))
View Full Code Here

      }
      catch(CvFileException e)
      {
        System.out.println("[Exception][SaveEditFileHandler.execute] Exception Thrown: "+e);
        ActionErrors allErrors = new ActionErrors();
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "This File Already Exists"));
        saveErrors(request, allErrors);
        FORWARD_final= FORWARD_editsavefile;
        request.setAttribute("bodycontent", "editdetailfile");
      }
      }
View Full Code Here

      int newFolderID = remote.addEmailFolder(newFolder, true);

      if (newFolderID < 1)
      {
        forward = errorForward;
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "The email folder could not be created. Please make sure all fields are filled in and try again. Also make sure you have privileges to create folders on your email server."));
        this.saveErrors(request, allErrors);
      }else{
        emailForm.set("closeWindow", new Boolean(true));
      }
     
View Full Code Here

      // now, check the message ID on the form...
      if (messageID == null || messageID.intValue() <= 0 ) {
        // if Message 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", "Message ID"));
        return(mapping.findForward(errorForward));
      }

      // This tells the Send.do handler to delete the
      // draft after it has been sent
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.