[ 
https://issues.apache.org/struts/browse/STR-1485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Niall Pemberton resolved STR-1485.
----------------------------------

       Resolution: Duplicate
    Fix Version/s:     (was: 1.4.0)
                   1.2.4

1) The original issue of the MessageFormat was fixed in Struts 1.2 (released in 
Struts 1.2.4) - although MessageFormat's setLocale() method was used rather 
than the constructor which required JDK 1.4 (and we were JDK 1.3 compatible at 
the time).

2) Struts 1.2.8 introduced a configuration option to turn off escaping single 
quotes to resolve the type of issue your're having - see STR-2304

3) HashMap does need to synchronise on read - its not safe if another process 
modifies at the time its being read. Could fix with concurrent HashMap when 
Struts minimum JDK version moves to JDK 1.5

> Locale missing when constructing a MessageFormat in MessageResources
> --------------------------------------------------------------------
>
>                 Key: STR-1485
>                 URL: https://issues.apache.org/struts/browse/STR-1485
>             Project: Struts 1
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.1 RC1
>         Environment: Operating System: All
> Platform: All
>            Reporter: Mike Baroukh
>            Priority: Minor
>             Fix For: 1.2.4
>
>
> in method
> org.apache.struts.util.MessageResources.getMessage(Locale locale, String key,
> Object args[]) 
> a MessageFormat is constructed : 
> ...
> format = new MessageFormat(escape(formatString));
> ...
> this line should be replaces with
> format = new MessageFormat(escape(formatString), locale);
> else it use the machine default locale instead of the locale asked for the 
> message.
> So, if a key contain something like
> mykey.format=the date is {0,date,EEEEEEE dd MMMM yyyy}
> the mesage will be internationalized but not the format of the date inside ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to