You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by fredk2 <fr...@gmail.com> on 2007/03/08 02:36:25 UTC

When webapps/ROOT does not exist the status code is 400 instead of 404, why?

Hi,

In Tomcat 5.5.16 - I forgot to define a context xml file for my application
and got status error code 400 which was puzzling.  After I added a ROOT
subdirectory to my webapps directory I got the status code 404, which was
less confusing.

Questions:
- I checked the http://tomcat.apache.org site but cannot find documentation
for ROOT. Is there any? 
- why code 400 and not 404 ?

Many thanks - Fred


Test:

Before ROOT was created:
-----------------------
bash$ telnet localhost 8080
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /test HTTP/1.1
Host: localhost

HTTP/1.1 400 No Host matches server name localhost
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
Date: Wed, 07 Mar 2007 23:45:04 GMT
Connection: close


After ROOT was created:
-----------------------
bash-2.04$ telnet localhost 8080
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /test HTTP/1.1
Host: localhost

HTTP/1.1 404 /test
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Length: 986
Date: Thu, 08 Mar 2007 00:48:46 GMT

.... error html from tomcat ....



-- 
View this message in context: http://www.nabble.com/When-webapps-ROOT-does-not-exist-the-status-code-is-400-instead-of-404%2C-why--tf3366756.html#a9367005
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org