Cannot get validation working with Spring Boot and Thymeleaf
Found the answer due to the tutorial here. I have to change my method signature from:
public String doRegistration( @Valid CustomerLicenseRegistration customerLicenseRegistration,
Model model,
BindingResult bindingResult )
to:
public String doRegistration( @Valid CustomerLicenseRegistration customerLicenseRegistration,
BindingResult bindingResult,
Model model )
Notice how the BindingResult
has to be immediately after the object I have annotated with @Valid
.