• Post Reply Bookmark Topic Watch Topic
  • New Topic

modification for chapter 12 validatingEntity  RSS feed

 
Himai Minh
Ranch Hand
Posts: 1514
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, in order validate the birthday of the employee is in the past using @Valid, the code has to be modified:








If you input 118 for the year, born in 2018, you will get

Validation failed. ConstraintViolations: [ConstraintViolationImpl{interpolatedMessage='must be in the past', propertyPath=info.dob, rootBeanClass=class examples.model.Employee, messageTemplate='{javax.validation.constraints.Past.message}'}]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!