I am using Spring MVC with JSR303 to validate input.
The form I created has a couple of date fields attached to the objects Datein the object that supports the form. I am using JSR303 to check for Dateusing @Future. I also use @DateTimeFormat(pattern="dd/MM/yyyy"), (I know this is not a check).
How to check the date format on Stringa form? If I leave the other required fields blank ( @NotEmpty) and enter an invalid date in the form "dd / MM / yy", it will be converted to "dd / MM / yyyy" when resubmitted (for example, 12/03/12 revised as 12/03 / 0012). This means that I will receive Duff data on my system. If I enter "aaa", I get a conversion exception. Correctly formatted is Stringconverted to Dateobjects.
In addition, the required annotation for the required field for fields Dateis equal to @NotNullor @NotEmpty?
Many thanks in advance for the advice provided.
source
share