Skip to Content
0
Former Member
Apr 19, 2017 at 10:31 AM

Custom Validator not showing any error message on front end

180 Views

Hi I have written custom validator which extends AddressValidator also I have created custom form which extends AddresForm . When i submit form it created errors in back end but some how it is not showing in front end .

     @Override
     public boolean supports(final Class<?> aClass)
     {
         return CustomAddressForm.class.equals(aClass);
     }
 
     @Override
     public void validate(final Object object, final Errors errors)
     {
         final AddressForm addressForm = (AddressForm) object;
         super.validate(addressForm, errors);
     }

And i called same from DeliveryAddressCheckoutStepController.java

addressValidator.validate(customAddressForm, bindingResult);.

Same is working if i pass addressForm object.