2011/1/25 Christopher Schultz <ch...@christopherschultz.net>:
> Should I expect that a request that doesn't map to a running context
> should return a 400 error? I would have expected a 404 Not Found.
>
> Tomcat 6.0.29 and Tomcat 7.0.6 both behave this way.
>
> With no ROOT context deployed, make a request to something that doesn't
> map to a deployed webapp, like "/nocontext" or even "/" and you'll get a
> 400 Bad Request.

It is a known issue, but I think that it is only of concern when the
ROOT webapp is temporarily unavailable, e.g. being redeployed.
In normal operation people do not see it.

Do you want to propose a patch? To return 404 instead of 400 when
request cannot be matched.

1) I think that it is somewhere around the Mapper class
2) I think that it is not possible to return well known green "page
404" html page (as valve is not available), but at least we can give
blank response with correct HTTP result code (like Http11Processor and
others do).

> HTTP Spec says 400 means "The request could not be understood by the
> server due to malformed syntax" but the request is perfectly valid.

Best regards,
Konstantin Kolinko

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

Reply via email to