Package org.apache.struts.action

Examples of org.apache.struts.action.ActionErrors


    } catch(Exception e) {
      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


      // 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)

View Full Code Here

      UserObject userObject = (UserObject)session.getAttribute("userobject");
      int individualID = userObject.getIndividualID();
      int ticketID = 0;
     
      // Check the session for an existing error message (possibly from the delete handler)
      ActionErrors allErrors =  (ActionErrors)session.getAttribute("listErrorMessage");
      if (allErrors != null) {
        saveErrors(request, allErrors);
        session.removeAttribute("listErrorMessage");
      }
     
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 = new ActionForward(request.getParameter("currentPage"), true);
    return forward;
  }
View Full Code Here

   @return errors ActionErrors
   */ 
  public ActionErrors validate (ActionMapping mapping, HttpServletRequest request)
  {
    // initialize new actionerror object
    ActionErrors errors = new ActionErrors();

    try
    {
      // 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

    }

    HttpSession session = request.getSession(true);
    // Check the session for an existing error message (possibly from the delete
    // handler)
    ActionErrors allErrors = (ActionErrors)session.getAttribute("listErrorMessage");
    if (allErrors != null) {
      saveErrors(request, allErrors);
      session.removeAttribute("listErrorMessage");
    }
View Full Code Here

      // After performing the logic in the DeleteHanlder, we are generate 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");
      }

      relatedInfoListForm.set("riListType", riListType);
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 = new ActionForward(request.getParameter("currentPage"), true);
    return forward;
  }
View Full Code Here

    HttpSession session = request.getSession();
    UserObject userObject = (UserObject)session.getAttribute("userobject");

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

    ActionErrors allErrors = new ActionErrors();
    String forward = ".view.email.compose";

    // "composeMailForm", defined in struts-config-email.xml
    DynaActionForm emailForm = (DynaActionForm)form;
View Full Code Here

    // set up the left nav menu
    HttpSession session = request.getSession();
    UserObject userObject = (UserObject)session.getAttribute("userobject");
    int individualID = userObject.getIndividualID(); // logged in user
    int entityID = userObject.getEntityId(); // logged in user's entityID
    ActionErrors allErrors = new ActionErrors();
    try {
      ListPreference listPrefs = userObject.getListPreference("USER");
      String filter = "SELECT a.UserID FROM user a, individual b, entity c where a.IndividualID = b.IndividualID and b.Entity = c.EntityID and c.EntityID = " + entityID;
      ValueListParameters listParameters = ActionUtil.valueListParametersSetUp(listPrefs, request, ValueListConstants.CUSTOMER_USER_LIST_TYPE, ValueListConstants.customerUserViewMap, false);
      listParameters.setFilter(filter);
      ValueList valueList = (ValueList)CVUtility.setupEJB("ValueList", "com.centraview.valuelist.ValueListHome", dataSource);
      ValueListVO listObject = valueList.getValueList(individualID, listParameters);
      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));
  } // end execute() method
View Full Code Here

TOP

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

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.