When using custom validation under this scenario:
if(officer.getBadgeId() == 0){
errors.rejectValue("badgeId", "badgeId.required");
}
if the POJO/Model officer has a datatype of int for the badgeId can a string be set as the error message for the attribute? Or the datatype of the attribute does not matter when doing validation and returning error messages to the view.
If it is an issue how do you handle this scenario in terms or returning an error message to the user from custom validation