Package com.opensymphony.xwork2.validator

Examples of com.opensymphony.xwork2.validator.ActionValidatorManager.validate()


                }
                exception = e;
            }

            if (alwaysInvokeValidate) {
                validateable.validate();
            }

            if (exception != null) {
                // rethrow if something is wrong while doing validateXXX / validateDoXXX
                throw exception;
View Full Code Here


    boolean errorsFound = false;
   
    for(Booking booking : bookings)
    {
      try {
        validator.validate(booking, "");
      } catch (ValidationException e) {
        addActionError("Booking for '" + booking.getName() + "' was invalid - "+e.getMessage());
        errorsFound = true;
        e.printStackTrace();
      }
View Full Code Here

    boolean errorsFound = false;
   
    for(Booking booking : bookings)
    {
      try {
        validator.validate(booking, "");
      } catch (ValidationException e) {
        addActionError("Booking for '" + booking.getName() + "' was invalid - "+e.getMessage());
        errorsFound = true;
        e.printStackTrace();
      }
View Full Code Here

        EmailValidator validator = new EmailValidator();
        validator.setValidatorContext(new DelegatingValidatorContext(action));
        validator.setFieldName("myEmail");
        validator.setDefaultMessage("invalid email");
        validator.setValueStack(ActionContext.getContext().getValueStack());
        validator.validate(action);

        return (action.getFieldErrors().size() == 0);
    }

    public boolean verifyEmailValidityWithExpression(final String email, final String expression) throws Exception {
View Full Code Here

        validator.setValidatorContext(new DelegatingValidatorContext(action));
        validator.setFieldName("myEmail");
        validator.setDefaultMessage("invalid email");
        validator.setRegexExpression("${emailExpression}");

        validator.validate(action);

        return (action.getFieldErrors().size() == 0);
    }

    public void testCaseSensitiveViaExpression() throws Exception {
View Full Code Here

        EmailValidator validator = new EmailValidator();
        validator.setValidatorContext(new DelegatingValidatorContext(action));
        validator.setFieldName("myEmail");
        validator.setDefaultMessage("invalid email");
        validator.setValueStack(ActionContext.getContext().getValueStack());
        validator.validate(action);

        return (action.getFieldErrors().size() == 0);
    }

    public boolean verifyEmailValidityWithExpression(final String email, final String expression) throws Exception {
View Full Code Here

        validator.setValidatorContext(new DelegatingValidatorContext(action));
        validator.setFieldName("myEmail");
        validator.setDefaultMessage("invalid email");
        validator.setRegexExpression("${emailExpression}");

        validator.validate(action);
        valueStack.pop();

        return (action.getFieldErrors().size() == 0);
    }
View Full Code Here

    EmailValidator validator = new EmailValidator();
    validator.setValidatorContext(new DelegatingValidatorContext(action));
    validator.setFieldName("myEmail");
    validator.setDefaultMessage("invalid email");
        validator.setValueStack(ActionContext.getContext().getValueStack());
        validator.validate(action);
   
    return (action.getFieldErrors().size() == 0);
  }
}
View Full Code Here

    EmailValidator validator = new EmailValidator();
    validator.setValidatorContext(new DelegatingValidatorContext(action));
    validator.setFieldName("myEmail");
    validator.setDefaultMessage("invalid email");
        validator.setValueStack(ActionContext.getContext().getValueStack());
        validator.validate(action);
   
    return (action.getFieldErrors().size() == 0);
  }
}
View Full Code Here

        EmailValidator validator = new EmailValidator();
        validator.setValidatorContext(new DelegatingValidatorContext(action));
        validator.setFieldName("myEmail");
        validator.setDefaultMessage("invalid email");
        validator.setValueStack(ActionContext.getContext().getValueStack());
        validator.validate(action);

        return (action.getFieldErrors().size() == 0);
    }

    public boolean verifyEmailValidityWithExpression(final String email, final String expression) throws Exception {
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.