You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Renato Romano <r....@set-network.com> on 2003/05/16 11:59:39 UTC

I18n Rendering of dates - Please Help

I want to render java.util.Date objects in jsp pages, using the
bean:write tag, based on the user locale, that is, for example,
dd/mm/yyyy for italian, mm-dd-yyyy for english etc... Does anyone know
how to do this ?

It would be even better to chose the output format at runtime (for
example sometimes I would render also time info) I read on struts doc
about registering PropertyEditor for the type, but I can't understand
where it is now configured on my JVM, but I know there is one, because
the renedered date is not date.toString()..., nor how to change those
settings and where ...

Thanks a lot
Renato

____________________________________
Renato Romano
Sistemi e Telematica S.p.A.
Calata Grazie - Vial Al Molo Giano
16127 - GENOVA

e-mail: r.romano@set-network.com
Tel.:   010 2712603
_____________________________________




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


RE: I18n Rendering of dates - Please Help

Posted by Renato Romano <r....@set-network.com>.
Right !! I did not find this hint, because I was running version 1.0.2
... But this forced me to upgrade...
Thanks again
 
Renato
 
 

____________________________________
Renato Romano
Sistemi e Telematica S.p.A.
Calata Grazie - Vial Al Molo Giano
16127 - GENOVA

e-mail: r.romano@set-network.com
Tel.:   010 2712603
_____________________________________


-----Original Message-----
From: Nagendra Kumar O V S [mailto:nagendra@ikigo.com] 
Sent: venerdì 16 maggio 2003 12.06
To: struts-user@jakarta.apache.org
Subject: Re: I18n Rendering of dates - Please Help



HI,
u can get the date for rendering on the jsp pages from the application
resources.
just define a key in the resources bundle like...
format.date=mm-dd-yyyy
and in ur jsp page ......
<bean:write name="dtVar" formatKey="format.date"/>
the dtVar should be of java.util.Date and the bean tag takes the dtVar &
format.date, does the conversion and renders in ur jsp
 
so if ur locale is changed , as the resource bundle changes the
corresponding format also gets reflected
 
nagi
 
-------Original Message-------
 
From: Struts Users Mailing  <ma...@jakarta.apache.org> List
Date: Friday, May 16, 2003 03:20:44 PM
To: 'Struts Users Mailing  <ma...@jakarta.apache.org> List'
Subject: I18n Rendering of dates - Please Help
 
I want to render java.util.Date objects in jsp pages, using the
bean:write tag, based on the user locale, that is, for example,
dd/mm/yyyy for italian, mm-dd-yyyy for english etc... Does anyone know
how to do this ?

It would be even better to chose the output format at runtime (for
example sometimes I would render also time info) I read on struts doc
about registering PropertyEditor for the type, but I can't understand
where it is now configured on my JVM, but I know there is one, because
the renedered date is not date.toString()..., nor how to change those
settings and where ...

Thanks a lot
Renato

____________________________________
Renato Romano
Sistemi e Telematica S.p.A.
Calata Grazie - Vial Al Molo Giano
16127 - GENOVA

e-mail: r.romano@set-network.com
Tel.: 010 2712603
_____________________________________




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


.

			
____________________________________________________
 <http://www.incredimail.com/redir.asp?ad_id=309&lang=9>   IncrediMail -
Email has finally evolved -
<http://www.incredimail.com/redir.asp?ad_id=309&lang=9> Click Here 


Re: I18n Rendering of dates - Please Help

Posted by Nagendra Kumar O V S <na...@ikigo.com>.
HI,
u can get the date for rendering on the jsp pages from the application
resources.
just define a key in the resources bundle like...
format.date=mm-dd-yyyy
and in ur jsp page ......
<bean:write name="dtVar" formatKey="format.date"/>
the dtVar should be of java.util.Date and the bean tag takes the dtVar &
format.date, does the conversion and renders in ur jsp

so if ur locale is changed , as the resource bundle changes the
corresponding format also gets reflected

nagi

-------Original Message-------

From: Struts Users Mailing List
Date: Friday, May 16, 2003 03:20:44 PM
To: 'Struts Users Mailing List'
Subject: I18n Rendering of dates - Please Help

I want to render java.util.Date objects in jsp pages, using the
bean:write tag, based on the user locale, that is, for example,
dd/mm/yyyy for italian, mm-dd-yyyy for english etc... Does anyone know
how to do this ?

It would be even better to chose the output format at runtime (for
example sometimes I would render also time info) I read on struts doc
about registering PropertyEditor for the type, but I can't understand
where it is now configured on my JVM, but I know there is one, because
the renedered date is not date.toString()..., nor how to change those
settings and where ...

Thanks a lot
Renato

____________________________________
Renato Romano
Sistemi e Telematica S.p.A.
Calata Grazie - Vial Al Molo Giano
16127 - GENOVA

e-mail: r.romano@set-network.com
Tel.: 010 2712603
_____________________________________




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


.