On Wed, Nov 4, 2009 at 2:54 PM, Siddiq Syed wrote:
>
> When you have a validation file like actionname-aliase-validation.xml and
> you want to carryout date validation in that as other validation , there is
> no direct way to do that.
>
Correct, this is a limitation, there currently is no way t
When you have a validation file like actionname-aliase-validation.xml and
you want to carryout date validation in that as other validation , there is
no direct way to do that.
Handling DateFormat.parse() is more java specific way and can be done in any
layer of the application.
The front-end val
Still a bad idea as it allows invalid dates (e.g. Nov. 31) and does nothing
for leap years.
If you want to know if a date is valid use DateFormat.parse().
On Wed, Nov 4, 2009 at 2:16 PM, Kawczynski, David <
david_kawczyn...@merck.com> wrote:
> That is unreadable. What about this, it's much eas
Does it checks for leap year ?
(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d
I guess this does not check for leap year, If the user enter the leap year
the framework passes the validation successfully. which it should not and
give you the error message.
Kawczynski, David wrot
That is unreadable. What about this, it's much easier on the eyes:
(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d
From
http://www.regular-expressions.info/regexbuddy/datemmdd.html
>
> Greg Lindholm-2 wrote:
> >
> >
> >>
> >>
> (((0[13578])|(1[02]))[\/]((0[1-9])|([12
But I guess there is no direct validation for a date in struts 2.
If you give date validation like mention below
01/01/1990
01/01/2000
Joining date must be supplied between ${min} and
${max}
It will check for the range , not the validation , like invalid value and
leap
>
> (((0[13578])|(1[02]))[\/]((0[1-9])|([12]\d)|(3[01])))|(((0[469])|(11))[\/]?((0[1-9])|([12]\d)|(30)))|((0?2)[\/]((0[1-9])|(1\d)|(2[0-8][\/](((19)|([1-9][0-9]))([\d][\d]|((0?2)[\/](29)[\/](((19)|([1-9][0-9]))(([02468][048])|([13579][26])$
>
>
>
>
IMHO this is unreadable and unma
As far as date validation are concerned , declare the date variable as string
in your view bean,
Add regular expression validation in the validation file.
(((0[13578])|(1[02]))[\/]((0[1-9])|([12]\d)|(3[01])))|(((0[469])|(11))[\/]?((0[1-9])|([12]\d)|(30)))|((0?2)[\/]((0[1-9])|(1\d)|(2[0-8]))
Hi All,
I have a Person object with a birthday attribute which is a Date. In
the form I have a textfield to enter the value. I want the field to
display the date in the format dd/MM/ and the validation to apply
using that format. However everything I am trying does not work.
I tried p
9 matches
Mail list logo