Examples of ActionErrors


Examples of org.apache.struts.action.ActionErrors

    UserObject userObject = (UserObject)session.getAttribute("userobject");

    int individualID = userObject.getIndividualID();    // logged in user
    int entityID = userObject.getEntityId();    // logged in user

    ActionErrors allErrors = new ActionErrors();

    // "customerProfileForm", defined in cv-struts-config.xml
    DynaActionForm profileForm = (DynaActionForm)form;

    // get the customer profile from the database
    ContactFacadeHome cfh = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome","ContactFacade");
   
    try {
      ContactFacade remote = (ContactFacade)cfh.create();
      remote.setDataSource(dataSource);
     
      // get the Entity record of the logged-in user's Entity
      EntityVO entityVO = (EntityVO)remote.getEntity(entityID);
     
      if (entityVO == null) {
        // let the user know something bad happened
        allErrors.add("error.general.databaseError", new ActionMessage("error.general.databaseError"));
        entityVO = new EntityVO();
      }
     
      IndividualVO primaryContactVO = entityVO.getIndividualVO();
      if (primaryContactVO == null) {
        // avoid null pointers
        primaryContactVO = new IndividualVO();
      }
     
      AddressVO primaryAddress = entityVO.getPrimaryAddress();
      if (primaryAddress == null) {
        // avoid null pointers
        primaryAddress = new AddressVO();
      }
     
      // now, populate the form bean with the data
      profileForm.set("entityName", entityVO.getName());
      profileForm.set("firstName", primaryContactVO.getFirstName());
      profileForm.set("middleName", primaryContactVO.getMiddleName());
      profileForm.set("lastName", primaryContactVO.getLastName());
      profileForm.set("title", primaryContactVO.getTitle());
      profileForm.set("street1", primaryAddress.getStreet1());
      profileForm.set("street2", primaryAddress.getStreet2());
      profileForm.set("city", primaryAddress.getCity());
      profileForm.set("zipCode", primaryAddress.getZip());
      profileForm.set("website", primaryAddress.getWebsite());
     
      GlobalMasterLists gml = GlobalMasterLists.getGlobalMasterLists(dataSource);
      Vector stateList = (Vector)gml.get("States");
      profileForm.set("state", primaryAddress.getStateName());
      Vector countryList = (Vector)gml.get("Country");
      profileForm.set("country", primaryAddress.getCountryName());
     
      Collection mocList = entityVO.getMOC();
      Iterator iterator = mocList.iterator();
      int count = 1;
      while (iterator.hasNext()) {
        MethodOfContactVO moc = (MethodOfContactVO)iterator.next();
        if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) {
          // this is for email
          profileForm.set("email", moc.getContent());
        } else if (count < 4 && moc.getMocType() != 1) {
          profileForm.set("mocType" + count, new Integer(moc.getMocType()).toString());
          String mocContent = moc.getContent();
          String mocContentValue = "";
          String mocContentExt = "";
          if (mocContent.indexOf("EXT") != -1) {
            String tempContent = mocContent;
            mocContentValue = tempContent.substring(0,tempContent.indexOf("EXT"));
            mocContentExt = tempContent.substring(tempContent.indexOf("EXT")+3,tempContent.length())  ;
          }else{
            mocContentValue = mocContent;
          }
          profileForm.set("mocContent" + count, mocContentValue );
          profileForm.set("mocExt" + count, mocContentExt );
          count++;
        }
      }
     
      if (! allErrors.isEmpty()) {
        saveErrors(request, allErrors);
      }
    }catch(Exception e){
      logger.error("[Exception] CustomerProfileHandler.Execute Handler ", e);
    }
View Full Code Here

Examples of org.apache.struts.action.ActionErrors

      // After performing the logic in the DeleteHanlder, we are generat a new request for the list
      // So we will not be carrying the old error. So that we will try to collect the error from the Session variable
      // Then destory it after getting the Session value
      if (session.getAttribute("listErrorMessage") != null)
      {
        ActionErrors allErrors = (ActionErrors) session.getAttribute("listErrorMessage");
        saveErrors(request, allErrors);
        session.removeAttribute("listErrorMessage");
      }//end of if (session.getAttribute("listErrorMessage") != null)
     
      NoteList DL = null ;
View Full Code Here

Examples of org.g4studio.core.mvc.xstruts.action.ActionErrors

      return false;
    }

    // Call the validate() method of this form bean
    ActionErrors errors = validate(actionCtx, actionConfig, actionForm);

    // If there were no errors, proceed normally
    if ((errors == null) || (errors.isEmpty())) {
      return false;
    }

    // Flag the validation failure and proceed
    /*
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.