1
My question is as follows. I have a JSP form for the registration of students with several attributes, one of them is the date of birth. Until then I was registering the date only validating the format (dd/MM/yyyy) and with Annotations. But now, I need to actually validate the date in a way that the user can’t register a later date than today and none of the ideas that I had and implemented in JPA worked. Someone knows a way to do it?
Could you demonstrate where you are doing the validation and what should happen if the validation fails? In particular, know if the validation is done in JSP, javascript, Servlet, taglib, spring, CDI or whatever. Reginaldo Rigo posted a reply that shows how to compare dates, but without you making it clear which is the place where you do the validation, which Annotation you use where, it is difficult to give a more complete answer than that.
– Victor Stafusa