In my Spring Application, i'm Using Hibernate Validator
for Validation Purpose.
When i'm doing simple Validation like @NotEmpty
, @Email
.. i'm easily working
But When coming to Date field, giving Problem...
Problem is in my Jsp page i'm getting values type as String then i'm convert String to Date..
Hear is my Example...
@NotEmpty(message = "Write Some Description")
private String description;
private String fromDateMonth;
private String fromDateYear;
private String toDateMonth;
private String toDateYear;
i'm converting this fromDateMonth
and fromDateYear
into Date in this my Controller class.
So is their any Possibility to add Validator Annotation in Controller class?
Other wise what should i'm do hear? give me suggestions...