You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Research labs <re...@yahoo.co.uk> on 2004/08/23 19:40:37 UTC
date parsing/validation
Can anyone please tell what I can do in order to stop
users from entering invalid dates. The validator does
not raise an error if a user enters 33 as ad day, as
in this sample date: 33/jan/2000.
I am using Struts validator, which is setup as
follows:
<field property="dob"
depends="maxlength,date">
<arg0 key="cargoForm.dob"/>
<arg1 name="maxlength"
key="${var:maxlength}" resource="false"/>
<var>
<var-name>datePattern</var-name>
<var-value>DD/MON/YYYY</var-value>
</var>
<var>
<var-name>maxlength</var-name>
<var-value>11</var-value>
</var>
</field>
Thanks.
___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: date parsing/validation
Posted by Research labs <re...@yahoo.co.uk>.
Noted. Thank you very much.
--- Erik Weber <er...@mindspring.com> wrote:
> Looks to me like you probably want dd/MM/yyyy.
>
> Erik
>
>
> Erik Weber wrote:
>
> > Please see the API documentation for
> java.text.SimpleDateFormat's
> > pattern syntax, which you are violating with
> DD/MON/YYYY. "MON" is not
> > an acceptable token, and DD is day-in-year, not
> day in month.
> >
> > Erik
> >
> >
> > Research labs wrote:
> >
> >> Can anyone please tell what I can do in order to
> stop
> >> users from entering invalid dates. The validator
> does
> >> not raise an error if a user enters 33 as ad day,
> as
> >> in this sample date: 33/jan/2000.
> >>
> >> I am using Struts validator, which is setup as
> >> follows:
> >> <field property="dob"
> >> depends="maxlength,date">
> >> <arg0 key="cargoForm.dob"/>
> >> <arg1 name="maxlength"
> >> key="${var:maxlength}" resource="false"/>
> >> <var>
> >> <var-name>datePattern</var-name>
> >> <var-value>DD/MON/YYYY</var-value>
> >> </var>
> >> <var>
> >> <var-name>maxlength</var-name>
> >> <var-value>11</var-value>
> >> </var>
> >> </field>
> >>
> >> Thanks.
> >>
> >>
> >>
> >>
> >>
> >>
>
___________________________________________________________ALL-NEW
>
> >> Yahoo! Messenger - all new features - even more
> fun!
> >> http://uk.messenger.yahoo.com
> >>
> >>
>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail:
> user-help@struts.apache.org
> >>
> >>
> >>
> >>
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> >
> >
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
>
>
___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: date parsing/validation
Posted by Erik Weber <er...@mindspring.com>.
Looks to me like you probably want dd/MM/yyyy.
Erik
Erik Weber wrote:
> Please see the API documentation for java.text.SimpleDateFormat's
> pattern syntax, which you are violating with DD/MON/YYYY. "MON" is not
> an acceptable token, and DD is day-in-year, not day in month.
>
> Erik
>
>
> Research labs wrote:
>
>> Can anyone please tell what I can do in order to stop
>> users from entering invalid dates. The validator does
>> not raise an error if a user enters 33 as ad day, as
>> in this sample date: 33/jan/2000.
>>
>> I am using Struts validator, which is setup as
>> follows:
>> <field property="dob"
>> depends="maxlength,date">
>> <arg0 key="cargoForm.dob"/>
>> <arg1 name="maxlength"
>> key="${var:maxlength}" resource="false"/>
>> <var>
>> <var-name>datePattern</var-name>
>> <var-value>DD/MON/YYYY</var-value>
>> </var>
>> <var>
>> <var-name>maxlength</var-name>
>> <var-value>11</var-value>
>> </var>
>> </field>
>>
>> Thanks.
>>
>>
>>
>>
>>
>> ___________________________________________________________ALL-NEW
>> Yahoo! Messenger - all new features - even more fun!
>> http://uk.messenger.yahoo.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: date parsing/validation
Posted by Erik Weber <er...@mindspring.com>.
Please see the API documentation for java.text.SimpleDateFormat's
pattern syntax, which you are violating with DD/MON/YYYY. "MON" is not
an acceptable token, and DD is day-in-year, not day in month.
Erik
Research labs wrote:
>Can anyone please tell what I can do in order to stop
>users from entering invalid dates. The validator does
>not raise an error if a user enters 33 as ad day, as
>in this sample date: 33/jan/2000.
>
>I am using Struts validator, which is setup as
>follows:
> <field property="dob"
> depends="maxlength,date">
> <arg0 key="cargoForm.dob"/>
> <arg1 name="maxlength"
>key="${var:maxlength}" resource="false"/>
> <var>
>
><var-name>datePattern</var-name>
>
><var-value>DD/MON/YYYY</var-value>
> </var>
> <var>
> <var-name>maxlength</var-name>
> <var-value>11</var-value>
> </var>
> </field>
>
>Thanks.
>
>
>
>
>
>___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org