struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Weber <erikwe...@mindspring.com>
Subject Re: struts date validator
Date Thu, 05 May 2005 17:17:23 GMT
Carl, sorry it took me so long to respond.

http://struts.apache.org/userGuide/dev_validator.html

Please see the section on date validation. You can specify the date 
pattern you want to use with a datePattern or datePatternStrict variable 
(within your "field" element). Since you are not including that 
variable, you are just using the default pattern (patterns are 
documented in java.text.SimpleDateFormat).

Erik


Carl Smith wrote:

>Here is my configuration in validation.xml, I need to validate date entered by user using
MM/dd/yyyy format. What is your suggestion? Thanks.
>
><form name="/mySubmitAction"> 
>
><field property="myDate" depends="date">
>
><msg name="date" key="myDate.format.mm.dd.yyyy"/>
>
></field>
>
></form>
>
>
>Erik Weber <erikweber@mindspring.com> wrote:I think you want datePatternStrict instead
of datePattern.
>
>Erik
>
>
>Carl Smith wrote:
>
>  
>
>>We are using struts date validator, for some reason we found that the struts "date"
validator let 04/02/05 pass, but we are hoping that the validation fails since 04/02/05 is
not of format MM/dd/yyyy.
>>
>>Did you have the same issue? What is the correct way to validate the date?
>>
>>Thanks.
>>
>>
>>
>>---------------------------------
>>Yahoo! Mail Mobile
>>Take Yahoo! Mail with you! Check email on your mobile phone.
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>		
>---------------------------------
>Yahoo! Mail
> Stay connected, organized, and protected. Take the tour
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message