Mark Thomas wrote:
On 18/12/2009 09:36, André Warnier wrote:
Christopher Schultz wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Abid,
On 12/17/2009 12:08 PM, Abid Hussain wrote:
I used the startup parameters
-Duser.language=en
-Duser.region=US
This caused Tomcat to deliver the Last-Modified in the correct format.
That solved the problem, no 404 anymore, thanks.
So it seems to be a bug in tomcat...?
I would say so.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1
Tomcat's behavior seems to ignore the specification, here. Would you
care to share your Tomcat version with us?
So far, I haven't seen anything that demonstrates Tomcat is generating
this header. It looks like an app issue to me. My testing with trunk,
6.0.x and 6.0.20 all show the correct format being used.
I think that once this is confirmed, it may be worth raising its
visibility a bit for the Tomcat developers.
As always before reporting an error, I'd highly recommend generating a
simple as possible test case that demonstrates the issue on a clean
Tomcat install. I can't repeat this and at the moment it looks like an
application issue. Any bug report that can't be repeated is just going
to get closed as WORKSFORME.
For a confirmation of what Mark says above, I ran some tests.
This Tomcat 5.5 is a pretty vanilla version, with just the standard
example apps and not much more, on my Windows workstation.
Versions are not the latest ones, I know.
INFO: Starting Servlet Engine: Apache Tomcat/5.5.26
Platform : Windows XP, German
Java :
java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)
Tomcat running as service, stopped and restarted before each test below
A) Platform default
Tomcat startup parameters as per tomcat5w.exe :
-Dcatalina.home=C:\Tomcat5.5
-Dcatalina.base=C:\Tomcat5.5
-Djava.endorsed.dirs=C:\Tomcat5.5\common\endorsed
-Djava.io.tmpdir=C:\Tomcat5.5\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\Tomcat5.5\conf\logging.properties
(platform default)
Request:
(Request-Line) GET /RELEASE-NOTES.txt HTTP/1.1
Host localhost:8180
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.3)
Gecko/20090824 Firefox/3.5.3
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-gb,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
If-Modified-Since Mon, 28 Jan 2008 20:38:54 GMT
If-None-Match W/"7697-1201552734000"
Cache-Control max-age=0
Response:
(Status-Line) HTTP/1.1 304 Not Modified
Server Apache-Coyote/1.1
Etag W/"7697-1201552734000"
Date Fri, 18 Dec 2009 11:37:58 GMT
B) Adding explicit "DE" startup parameters
Tomcat startup parameters as per tomcat5w.exe :
-Dcatalina.home=C:\Tomcat5.5
-Dcatalina.base=C:\Tomcat5.5
-Djava.endorsed.dirs=C:\Tomcat5.5\common\endorsed
-Djava.io.tmpdir=C:\Tomcat5.5\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\Tomcat5.5\conf\logging.properties
-Duser.language=de
-Duser.region=DE
Request :
(Request-Line) GET /RELEASE-NOTES.txt HTTP/1.1
Host localhost:8180
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.3)
Gecko/20090824 Firefox/3.5.3
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-gb,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
If-Modified-Since Mon, 28 Jan 2008 20:38:54 GMT
If-None-Match W/"7697-1201552734000"
Cache-Control max-age=0
Response :
(Status-Line) HTTP/1.1 304 Not Modified
Server Apache-Coyote/1.1
Etag W/"7697-1201552734000"
Date Fri, 18 Dec 2009 11:26:01 GMT
C) Adding explicit "FR" startup parameters
Tomcat startup parameters as per tomcat5w.exe :
-Dcatalina.home=C:\Tomcat5.5
-Dcatalina.base=C:\Tomcat5.5
-Djava.endorsed.dirs=C:\Tomcat5.5\common\endorsed
-Djava.io.tmpdir=C:\Tomcat5.5\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\Tomcat5.5\conf\logging.properties
-Duser.language=fr
-Duser.region=FR
Request;
(Request-Line) GET /RELEASE-NOTES.txt HTTP/1.1
Host localhost:8180
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.3)
Gecko/20090824 Firefox/3.5.3
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-gb,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
If-Modified-Since Mon, 28 Jan 2008 20:38:54 GMT
If-None-Match W/"7697-1201552734000"
Cache-Control max-age=0
Response:
(Status-Line) HTTP/1.1 304 Non Modifié
Server Apache-Coyote/1.1
Etag W/"7697-1201552734000"
Date Fri, 18 Dec 2009 11:34:13 GMT
In other words, changing the
-Duser.language=xx
-Duser.region=xx
Java command-line parameters don't seem to make a difference in the
headers returned by Tomcat, and these headers do not seem to include an
"Last-Modified" header.
If you look closely at the 3d example above however, you'll see that the
HTTP status line, in the French case, /is/ modified compared to the
default. So Tomcat definitely is sensitive to the JVM language setting
for some things.
Finally, I added a test with a new file, to see if I could obtain the
Last-Modified header somehow :
D) still French settings
Tomcat startup parameters as per tomcat5w.exe :
-Dcatalina.home=C:\Tomcat5.5
-Dcatalina.base=C:\Tomcat5.5
-Djava.endorsed.dirs=C:\Tomcat5.5\common\endorsed
-Djava.io.tmpdir=C:\Tomcat5.5\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\Tomcat5.5\conf\logging.properties
-Duser.language=fr
-Duser.region=FR
Request:
(Request-Line) GET /RELEASE-NOTES_updated.txt HTTP/1.1
Host localhost:8180
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.3)
Gecko/20090824 Firefox/3.5.3
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-gb,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Response:
(Status-Line) HTTP/1.1 200 OK
Server Apache-Coyote/1.1
Etag W/"7697-1201552734000"
Last-Modified Mon, 28 Jan 2008 20:38:54 GMT
Content-Type text/plain
Content-Length 7697
Date Fri, 18 Dec 2009 11:47:39 GMT
This time (1st request for a new document), I did get a "Last-Modified"
header, but despite the French setting, it is definitely an English
Last-Modified date.
It seems that in some cases, the Last-Modified header /is/ being
generated by Tomcat, but it is always the "en" version.
Hope this helps
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org