tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Response Code for Errors
Date Tue, 04 Dec 2001 17:35:20 GMT
On Tue, 4 Dec 2001, Manoj Dandge wrote:

> Date: Tue, 4 Dec 2001 10:57:16 +0530
> From: Manoj Dandge <manoj.dandge@wipro.com>
> Reply-To: Tomcat Developers List <tomcat-dev@jakarta.apache.org>
> To: tomcat-dev@jakarta.apache.org
> Subject: Response Code for Errors
>
> Hi , I am using tomcat 4 to run the servlets. And I am accessing the
> servlets using javacode(HttpURLConnection class and its
> getInputStream, getResponseMessage and getResponseCode) This is
> working well for existing servlets. But If I try to access servlet
> with wrong name I should get the corresponding ResponseCode and
> responseMessage. (e.g. 404/ Not Found) but I am getting response code
> and message as blank. However if seen in browser I get proper message
> for corresponding errors. Can u pl help me how I can get same code and
> message (what I can get browser) using java code. Thanks and Regards,
> ...ManojD
>

This is a user question, and is therefore best directed to the TOMCAT-USER
list, not here.

In my experience, HttpURLConnection throws a FileNotFoundException when
the server returns a 404.

Craig McClanahan



--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message