Hello,
I am creating a form where a user will register with a struts2 application. It will be required for the user to input a date in a specific format.
Since I am not going to use the datepicker ajax tag, I am using a textfield with a date tag in the form like this:
<s:date name="birthDate" id="bDateId" format="yyyy-MM-dd"/>
<s:textfield name="birthDate" id="%{bDateId}" label="Birth Date (yyyy-MM-dd)"/>
The underlying user entity has a String field to represent the date. So my question is if there is a straighforward way to apply validation against the user input format for the date field. The date validator provided by struts2 can be used to check date ranges only, but not specific formats.
Would anyone recommend a way to do this, or wouldn;t mind pointing to an example of a custom validator?
Thanks for your advice Regards to all