struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <ahardy.str...@cyberspaceroad.com>
Subject Re: Date validator and I18N
Date Wed, 14 Apr 2004 08:02:47 GMT
When I last looked, BeanUtils had a bug/deficiency in it that meant it 
didn't convert dates by locale, despite having the classes & methods 
which looked like it should.

Just a warning - although that was a few months back.

Adam

On 04/14/2004 04:51 AM Joe Hertz wrote:
> Yes, you can get the dates validated this way, but isn't actually the
> tough hurdle.
> 
> You've got Date objects being stored some place.
> 
> You'll need them displayed as Strings in your Action Form. You'll need
> them formatted by Locale.
> 
> You'll want want the Strings converted back to Dates in the processing
> Action. You'll need them parsed by Locale.
> 
> Unless someone can offer a better explanation of the usage of
> LocaleBeanUtils than I can, this may prove to be quite the annoying
> little repeated task.
> 
> -Joe
> 
> 
>>-----Original Message-----
>>From: Jeff Caesar [mailto:jcaesar@callidussoftware.com] 
>>Sent: Tuesday, April 13, 2004 7:04 PM
>>To: Struts Users Mailing List
>>Subject: RE: Date validator and I18N
>>
>>
>>I haven't personally tried doing this, but according to the 
>>doc you can specify language/country/variant on the formset 
>>when defining your validation so that the validator will 
>>choose the best one available for the given user's locale.
>>
>>>From the validator DTD:
>><!--
>>      The "formset" element defines a set of forms for a 
>>locale. Formsets for
>>      specific locales can override only those fields that change. The
>>      localization is properly scoped, so that a formset can 
>>override just the
>>      language, or just the country, or both.
>>-->
>><!ELEMENT formset (constant*, form+)>
>><!ATTLIST formset language CDATA #IMPLIED>
>><!ATTLIST formset country CDATA #IMPLIED>
>><!ATTLIST formset variant CDATA #IMPLIED>
>>
>>So you would want to create four different <formset> defs 
>>(one for each of your languages plus a default) for the form.
>>
>>Jeff
>>
>>-----Original Message-----
>>From: Stjepan Brbot [mailto:stjepan.brbot@ht.hr] 
>>Sent: Tuesday, April 13, 2004 3:07 PM
>>To: user@struts.apache.org
>>Subject: Date validator and I18N
>>
>>
>>In my web application I deal with three languages (Croatian, 
>>German and English). Application does have forms allowing 
>>user to input a date value. When english locale is active 
>>user must have the ability to insert date in english date 
>>format (mm/dd/yyyy), also croatian and german users must have 
>>the ability to insert dates in their own date format 
>>(dd.mm.yyyy). How to define a validation for such a 
>>situation? In mask for date validation (in validation.xml) I 
>>can define only one date format pattern!
>>
>>Stjepan Brbot
>>
>>
>>---------------------------------------------------------------------
>>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
> 
> 


-- 
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian


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


Mime
View raw message