Examples of ActionError


Examples of org.apache.empire.struts2.actionsupport.ActionError

        setActionError(new ActionError(errType));
    }

    protected final void setActionError(ErrorType errType, String param)
    {
        setActionError(new ActionError(errType, param));
    }
View Full Code Here

Examples of org.apache.empire.struts2.actionsupport.ActionError

    }

    @Override
    public final void setActionError(Exception exception)
    {
        setActionError(new ActionError(exception));
    }
View Full Code Here

Examples of org.apache.empire.struts2.actionsupport.ActionError

        // Get Message
        String msgKey = error.getErrorType().getKey();
        String[] args = ObjectUtils.toStringArray(error.getErrorParams(), "Null");
        String msg = getText(msgKey, args);
        // Get full Message
        addItemError(item, new ActionError(errorType, new String[] { title, msg }));
    }
View Full Code Here

Examples of org.apache.struts.action.ActionError

    try {
      Mapping.begin();
      User user = User.getInstance(login);
      Mapping.rollback();
      if (!lform.getPassword().equals(user.getPassword())) {
        ActionError error = new ActionError("error.login.badPassword");
        ActionErrors errors = new ActionErrors();
        errors.add("password", error);
        request.setAttribute(ERROR_KEY, errors);
        return (new ActionForward(mapping.getInput()));
      }
      Mapping.begin();
      boolean result = new SecurityManagerImpl().canLogIntoBackoffice(user);
      Mapping.rollback();
      if ( !result ) {
        ActionError error = new ActionError("error.login.notAuthorized");
        ActionErrors errors = new ActionErrors();
        errors.add("login", error);
        request.setAttribute(ERROR_KEY, errors);
        return (new ActionForward(mapping.getInput()));
      }
      request.getSession().setAttribute("userLogin",user.getLogin());
    } catch (Exception e) {
      Mapping.rollback();
      ActionError error = new ActionError("error.login.badLogin");
      ActionErrors errors = new ActionErrors();
      errors.add("login", error);
      request.setAttribute(ERROR_KEY, errors);
      return (new ActionForward(mapping.getInput()));
    }  
View Full Code Here

Examples of org.apache.struts.action.ActionError

          Mapping.rollback();
          throw new ServletException(e);
        }
      } else {
        ActionErrors errors = new ActionErrors();
        ActionError error = new ActionError("error.search.noKeyWords");
        errors.add("keys",error);
        request.setAttribute(ERROR_KEY,errors);
      }
    }
View Full Code Here

Examples of org.apache.struts.action.ActionError

    ActionErrors errors = new ActionErrors()
    SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
    try {
      formatter.parse(getDate());
    } catch( Exception e ) {
      ActionError error = new ActionError("error.general.badDate");
      errors.add("date",error);
    }
    return errors;
  }
View Full Code Here

Examples of org.apache.struts.action.ActionError

   * @see org.apache.struts.action.ActionForm#validate(ActionMapping, HttpServletRequest)
   */
  public ActionErrors myValidate(HttpServletRequest request) {
    ActionErrors errors = new ActionErrors()
    if ("".equals(getName()) || getName()==null) {
      ActionError error =
        new ActionError("error.createUser.nameMissing");
      errors.add("name", error);
    }
    if ("".equals(getEmail()) || getEmail()==null) {
      ActionError error =
        new ActionError("error.createUser.emailMissing");
      errors.add("email", error);
    }
    if ("".equals(getLogin()) || getLogin()==null) {
      ActionError error =
        new ActionError("error.createUser.loginMissing");
      errors.add("login", error);
    }
    if ("".equals(getPassword()) || getPassword()==null) {
      ActionError error =
        new ActionError("error.createUser.passwordMissing");
      errors.add("password", error);
   
    return errors;
  }
View Full Code Here

Examples of org.apache.struts.action.ActionError

   * @see org.apache.struts.action.ActionForm#validate(ActionMapping, HttpServletRequest)
   */
  public ActionErrors myValidate(HttpServletRequest request) {
    ActionErrors errors = new ActionErrors()
    if ("".equals(getName()) || getName()==null) {
      ActionError error =
        new ActionError("error.editUser.nameMissing");
      errors.add("name", error);
    }
    if ("".equals(getEmail()) || getEmail()==null) {
      ActionError error =
        new ActionError("error.editUser.emailMissing");
      errors.add("email", error);
    }
    if ("".equals(getPassword()) || getPassword()==null) {
      ActionError error =
        new ActionError("error.editUser.passwordMissing");
      errors.add("password", error);
   
    return errors;
  }
View Full Code Here

Examples of org.apache.struts.action.ActionError

          e.printStackTrace();
        }
   
    ActionErrors errors = new ActionErrors();
    if (getName() == null) {
      ActionError error =
        new ActionError("error.uploadResource.missingName");
      errors.add("name", error);     
    } else {
      if (getName().trim().equals("")) {
        ActionError error2 =
          new ActionError("error.uploadResource.missingName");
        errors.add("name", error2);
      } else {
        if (getName().indexOf(".") != -1
          || getName().indexOf("/") != -1
          || getName().indexOf("\\") != -1
          || getName().indexOf("%") != -1
          || getName().indexOf("&") != -1) {
          ActionError error3 =
            new ActionError("error.uploadResource.badName");
          errors.add("name", error3);

        }
      }
    }
    if (getFile().getFileSize() == 0) {
      ActionError error =
        new ActionError("error.uploadResource.missingFile");
      errors.add("file", error);     
    }
    return errors;
  }
View Full Code Here

Examples of org.apache.struts.action.ActionError

   * @see org.apache.struts.action.ActionForm#validate(ActionMapping, HttpServletRequest)
   */
  public ActionErrors myValidate(HttpServletRequest request) {
    ActionErrors errors = new ActionErrors();
    if( "".equals(getName()) ) {
      ActionError error = new ActionError("error.createPublication.nameMissing");
      errors.add("name",error);
    }
    if( "".equals(getType()) ) {
      ActionError error = new ActionError("error.createPublication.typeMissing");
      errors.add("type",error);
    }
    if( "".equals(getWorkflow()) ) {
      ActionError error = new ActionError("error.general.missingField");
      errors.add("workflow",error);
    }
    return errors;
  }
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.