On 11/09/2013 01:24, Konstantin Kolinko wrote:
> 2013/8/16  <ma...@apache.org>:
>> Author: markt
>> Date: Thu Aug 15 20:51:38 2013
>> New Revision: 1514485
>>
>> URL: http://svn.apache.org/r1514485
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55399
>> Have the message in the response line use the locale set for the response.
>>
>> Modified:
>>     tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
>>     tomcat/trunk/java/org/apache/coyote/http11/AbstractOutputBuffer.java
>>     tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java
>>     tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java
>>
> 
>>
>> +
>> +    public static HttpMessages getInstance(Locale locale) {
>> +        HttpMessages result = instances.get(locale);
>> +        if (result == null) {
>> +            StringManager sm = StringManager.getManager(
>> +                    "org.apache.tomcat.util.http.res", locale);
>> +            if (Locale.getDefault().equals(sm.getLocale())) {
>> +                result = DEFAULT;
>> +            } else {
>> +                result = new HttpMessages(sm);
>> +            }
>> +            instances.put(locale, result);
>> +        }
>> +        return result;
>> +    }
>> +
> 
> What a bit bothers me here (and in earlier changes to ErrorReportValve
> etc. - r1514496) is that locale is provided by client and thus the
> caches here and in StringManager can grow, instead of being limited to
> the few locales that are actually bundled with Tomcat.

That is a fair point. I'll take another look.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to