Examples of FieldError


Examples of org.springframework.validation.FieldError

            constrainedPropertyName = propertyName.substring(i + 1, propertyName.length());
        }
        else {
            constrainedPropertyName = propertyName;
        }
        FieldError fieldError = errors.getFieldError(constrainedPropertyName);
        if (fieldError == null) {
            ConstrainedProperty c = (ConstrainedProperty) constrainedProperties.get(constrainedPropertyName);
            c.setMessageSource(messageSource);
            c.validate(obj, bean.getPropertyValue(constrainedPropertyName), errors);
        }
View Full Code Here

Examples of org.springframework.validation.FieldError

    protected boolean validate(Validator validator, Object form, BindingResult result, ZeroView view) {
        boolean hasError = false;
        validator.validate(form, result);
        if (result.hasErrors()) {
            for (Object o : result.getFieldErrors()) {
                FieldError error = (FieldError) o;
                if (!hasError && error.getCode() != null && !error.getCode().equals("")) {
                    hasError = true;
                    if (error.getCode().equals("typeMismatch")) {
                        view.setMessage(new Message("zero.msg.invalid_input", Message.MSG_ERROR, error.getArguments()));
                    } else {
                        view.setMessage(new Message(error.getCode(), Message.MSG_ERROR, error.getArguments()));
                    }
                }
                view.highlightField(error.getField());
            }
            view.getJson().element("popuperror", true);
            return false;
        }
        return true;
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.