|
Spring Framework example source code file (PetSiteValidator.java)
The Spring Framework PetSiteValidator.java source codepackage org.springframework.samples.petportal.validation; import org.springframework.samples.petportal.domain.PetSite; import org.springframework.validation.Errors; import org.springframework.validation.ValidationUtils; /** * A validator for {@link PetSite PetSite} objects. * * @author Mark Fisher * @author Juergen Hoeller */ public class PetSiteValidator { public void validate(PetSite petSite, Errors errors) { ValidationUtils.rejectIfEmpty(errors, "name", "NAME_REQUIRED", "Name is required."); ValidationUtils.rejectIfEmpty(errors, "url", "URL_REQUIRED", "URL is required."); } } Other Spring Framework examples (source code examples)Here is a short list of links related to this Spring Framework PetSiteValidator.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.