• Post Reply Bookmark Topic Watch Topic
  • New Topic

modification for chapter 12 validatingEntity

 
Himai Minh
Ranch Hand
Posts: 1400
8
  • 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}'}]
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!