Package juzu.plugin.validation

Examples of juzu.plugin.validation.ValidationError


  @Override
  public Response handle(Stage.Invoke argument) {
    if (validator != null) {
      Set<ConstraintViolation<Object>> violations = validator.forExecutables().validateParameters(argument.getController(), argument.getMethod(), argument.getArguments());
      if (violations.size() > 0) {
        return new ValidationError(violations);
      }
    }
    return argument.invoke();
  }
View Full Code Here


  @Override
  public void endRequest(RequestContext context) {
      Response response = context.getResponse();
      if (response instanceof ValidationError) {
        ValidationError error = (ValidationError)response;
        String id = context.getParameters().get("id").getValue();
       
        Iterator<ConstraintViolation<Object>> v = error.getViolations().iterator();
        Booking booking = (Booking)error.getViolations().iterator().next().getLeafBean();
        while (v.hasNext()) {
          ConstraintViolation<Object> c = v.next();
          Iterator<javax.validation.Path.Node> nodeIter = c.getPropertyPath().iterator();
          javax.validation.Path.Node node = null;
          while (nodeIter.hasNext()) {
View Full Code Here

  @Override
  public void endRequest(RequestContext context) {
      Response response = context.getResponse();
      if (response instanceof ValidationError) {
        ValidationError error = (ValidationError)response;       
        violation.add(Violation.REGISTER, error.getHtmlMessage());
       
        context.setResponse(Application_.register());
      }
   }
View Full Code Here

TOP

Related Classes of juzu.plugin.validation.ValidationError

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.