-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark,

On 12/18/2009 5:32 AM, Mark Thomas wrote:
> On 18/12/2009 08:41, Abid Hussain wrote:
>> Hi,
>>
>> I'm using Tomcat 6.0.20, installed on a german Windows XP.
>>
>> I'm quite sure that the cause is tomcat's code.
> 
> And I'm quite sure it isn't. I have tested trunk, 6.0.x and 6.0.20 and
> all behave correctly.
> 
>> When I use e.g. for 
>> startup polish locale:
>> -Duser.language=pl
>> -Duser.region=PL
>> Tomcat delivers the Last-Modified header in polish:
>> Pt, 18 gru 2009 08:33:49 GMT
>>
>> The Date header is always in correct format, no matter what locale is 
>> configured:
>> Fri, 18 Dec 2009 08:33:49 GMT
> 
> If Tomcat generates the Last-Modified header, it generates it the same
> way as it generates the Date header.

Yes and no: the Http11Processor, for example, uses
o.a.t.util.http.FastHttpDateFormat.getCurrentDate() (which uses a
SimpleDateFormat configured for Locale.US), while the DefaultServlet
uses its own SimpleDateFormat similarly configured.

> What looks more likely at this point is an application level component
> generating the header and using the default Locale rather than the US
> Locale.

I completely agree. One way to find this would be to write a filter that
wraps the request and dumps a stack trace when that header is set:

public void addHeader(String name, String value) {
  if("Date".equalsIgnoreCase(name))
    new Throwable("Date header is being added").printStackTrace();

  super.setHeader(name, value);
}

and

public void setHeader(String name, String value) {
  if("Date".equalsIgnoreCase(name))
    new Throwable("Date header is being set").printStackTrace();

  super.setHeader(name, value);
}

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksro0EACgkQ9CaO5/Lv0PCkwACdFF3QFQLm8AyaLSNyPcBD16oF
THMAn1BQo25wrXVCWOcBo6hzCdXd+G+W
=Bjv6
-----END PGP SIGNATURE-----

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

Reply via email to