Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 1 localized date in MessageFormat string

 
Bob Dietrich
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic