Maybe I misunderstand something, but when I use only onBindAndValidate(), I mean there are no validators, but there are validation errors, then isFormChangeRequest() method won't get called.
BaseCommmandController's bindAndValidate() method:
so, when there are no validators, then suppressValidation (which calls isFormChangeRequest() in SimpleFormController) doesn't get called.Code:if (this.validators != null && isValidateOnBinding() && !suppressValidation(request)) {...} onBindAndValidate(...);
SimpleFormController's processFormSubmission() method:
so if I use onBindAndValidate() for validation and there are validation errors, then isFormChangeRequest() doesn't get called again.Code:if (errors.hasErrors() || isFormChangeRequest(request)) ...
Is it the normal way, or am I missing something?
Won't it be a better way to check isFormChangeRequest first, and if it returns false, then make the validation?


Reply With Quote