struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Benedict" <pbened...@apache.org>
Subject Re: Using default date format according to current Locale
Date Tue, 28 Aug 2007 23:22:21 GMT
Sounds like you want a dynamic property file :-) That's the only thing I can
think of.

On 8/28/07, darfy@kastortv.org <darfy@kastortv.org> wrote:
>
>
> Hi all !
>
> I'm trying to use pretty correctly Locale with Struts (1.2.8).
>
> I want to display for exemple a Date in current user Locale. Currently I
> use this method :
> <bean:write name="localizationForm" property="date"
> formatKey="format.date.short"/>
>
> with the adequate formatKey in my localized MessageRessources*.properties.
> This works perfectly, but...
>
> Since I just put in these .properties default short date format, is there
> a
> convenient way with Struts to use Java native default date format ?
>
> (in other words, I want an output like this, where I don't manually define
> the format :
> DateFormat sdf = SimpleDateFormat.getDateInstance(SimpleDateFormat.SHORT,
> locale);
> System.out.println(sdf.format(new Date()));
> )
>
> Thanks in advance for your help !
>
> Valentin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message