Package javax.faces.validator

Examples of javax.faces.validator.ValidatorException


    String value = obj.toString();
   
    if(value.equals(""))
    {
     
      throw new ValidatorException(new FacesMessage("请选择,查询类型!"));
    }
  }
View Full Code Here


  }
  public void validateInput(FacesContext context,  
          UIComponent component, Object value){
    String text = value.toString()
      if(text.equals("")){ 
          throw new ValidatorException(new FacesMessage("内容不能为空!"));
     
  }
View Full Code Here

      message.setDetail(FacesUtil.getMessage("messageValidateEmail"));
      message.setSummary(FacesUtil.getMessage("messageValidateEmail"));
   
      message.setSeverity(FacesMessage.SEVERITY_ERROR);
       
      throw new ValidatorException(message);
    }
  }
View Full Code Here

      message.setDetail(FacesUtil.getMessage("messageValidateCPF"));
      message.setSummary(FacesUtil.getMessage("messageValidateCPF"));
   
      message.setSeverity(FacesMessage.SEVERITY_ERROR);
       
      throw new ValidatorException(message);
    }
  }
View Full Code Here

    {
      _getEmailList(value.toString());
    }
    catch (AddressException ae)
    {
      throw new ValidatorException(
       MessageUtils.getErrorMessage(context,
                                    "EMAIL_LIST_ERROR",
                                    new Object[]{ae.getRef()}));

    }
View Full Code Here

        if (null != comparator)
        {
            if (false == validateOperatorOnComparisonResult(operator, comparator.compare(value, foreignValue)))
            {
                throw new ValidatorException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, message, args));
            }
        }
        else if ( (value instanceof Comparable) && (foreignValue instanceof Comparable) )
        {
            try
            {
                if (false == validateOperatorOnComparisonResult(operator, ((Comparable)value).compareTo(foreignValue)))
                {
                    throw new ValidatorException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, message, args));
                }
            }
            catch (RuntimeException exception)
            {
                if (exception instanceof ValidatorException)
                {
                    throw exception;
                }
                else
                {
                    throw new ValidatorException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, message + ": " + exception.getLocalizedMessage(), args));
                }
            }
        }
        else if (value instanceof Comparable)
        {
View Full Code Here

    LabeledFacesMessage lfm =
      new LabeledFacesMessage(FacesMessage.SEVERITY_ERROR,
                              "Validation Error",
                              "The password must contain at least one number");
    lfm.setLabel(_getLabel(component));
    throw new ValidatorException(lfm);
  }
View Full Code Here

      {
        return;
      }
      if (!GenericValidator.isEmail(value.toString().trim())) {
        Object[] args = {value.toString()};
              throw new ValidatorException(getFacesMessage(EMAIL_MESSAGE_ID, args));
      }

  }
View Full Code Here

      {
        return;
    }
    Object[] args = {value.toString()};
    if(!GenericValidator.matchRegexp(value.toString(),"^"+getPattern()+"$")){
      throw new ValidatorException(getFacesMessage(REGEXPR_MESSAGE_ID, args));
        }
  }
View Full Code Here

        return;
      }
    initValidator();
    if (!this.creditCardValidator.isValid(value.toString())){
      Object[] args = {value.toString()};
            throw new ValidatorException(getFacesMessage(CREDITCARD_MESSAGE_ID, args));
    }
  }
View Full Code Here

TOP

Related Classes of javax.faces.validator.ValidatorException

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.