Package org.apache.commons.validator

Examples of org.apache.commons.validator.Validator


        ServletContext application = getServlet().getServletContext();
        ActionErrors errors = new ActionErrors();

        String validationKey = getValidationKey(mapping, request);

        Validator validator =
            Resources.initValidator(validationKey, this, application, request,
                errors, page);

        try {
            validatorResults = validator.validate();
        } catch (ValidatorException e) {
            log.error(e.getMessage(), e);
        }

        return errors;
View Full Code Here


        ServletContext application = getServlet().getServletContext();
        ActionErrors errors = new ActionErrors();

        String validationKey = getValidationKey(mapping, request);

        Validator validator =
            Resources.initValidator(validationKey, this, application, request,
                errors, page);

        try {
            validatorResults = validator.validate();
        } catch (ValidatorException e) {
            log.error(e.getMessage(), e);
        }

        return errors;
View Full Code Here

   */
  public ConstraintExceptionBuffer validate(ContentTypeDefinitionVO contentType, ContentVersionVO contentVersionVO, String languageCode) {
    try {
      ContentVersionBean bean = new ContentVersionBean(contentType, contentVersionVO, languageCode);
      ValidatorResources resources = loadResources(contentType, languageCode);
      Validator validator = new Validator(resources, "requiredForm");
      validator.setOnlyReturnErrors(true);
      validator.setParameter(Validator.BEAN_PARAM, bean);
      ValidatorResults results = validator.validate();
      if(results.isEmpty())
        return new ConstraintExceptionBuffer();
      else
        return populateConstraintExceptionBuffer(results, contentVersionVO, languageCode);
    } catch(Exception e) {
View Full Code Here

        if (validatorFormName == null)
        {
            return result; // no validation for this bean
        }

        Validator validator = new Validator(validations, validatorFormName);

        // Tell the validator which bean to validate against.
        validator.setParameter(Validator.BEAN_PARAM, bean);
       
        // Parameters used by our validators
        validator.setParameter("java.util.Map", result);
        validator.setParameter("java.util.ResourceBundle", bundle);
       
        ValidatorResults results = null;
               
        try
        {
            validator.setOnlyReturnErrors(true);
            results = validator.validate();
            if (results.isEmpty())
            {
                return result;
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.commons.validator.Validator

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.