It's not a secret anymore!*
The moose likes Struts and the fly likes Struts 1 localized date in MessageFormat string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 1 localized date in MessageFormat string" Watch "Struts 1 localized date in MessageFormat string" New topic
Author

Struts 1 localized date in MessageFormat string

Bob Dietrich
Greenhorn

Joined: Sep 02, 2010
Posts: 3
Sorry, I couldn't find the answer to this Struts 1 question elsewhere.

I am trying to format a date for different locales. I'm calling the equivalent of:


where DATEFMT is the string "{0,date,long}" (minus quotes of course).

Unfortunately, the date always comes out in my default locale rather than the passed locale. If I construct a MessageFormat using the string and locale, the date is formatted correctly.

What am I doing wrong? Thanks.
 
jQuery in Action, 2nd edition
 
subject: Struts 1 localized date in MessageFormat string
 
Similar Threads
How to retrieve Internationalized messages from .java code base?
Regarding ListResourceBundle
Formatting long
JiBX Exception: Missing 'T' separator in dateTime
MessageFormat