Redundant validation
Closed this issue · 0 comments
MinaYousryGhattas commented
public void validatename(Errors errors , AddProductForm addProductForm) { if(addProductForm.getName() == null || addProductForm.getName() == "") errors.rejectValue("name" , "NotEmpty"); // if(productRepository.findOneByName(addProductForm.getName()).isPresent()) // errors.rejectValue("name" , "msg.DuplicateProductName"); }
you don't have to validate this attributes cuz they automatically validated by adding notation NotEmpty in form class..