On Tue, 4 Dec 2001, Manoj Dandge wrote:

> Date: Tue, 4 Dec 2001 10:57:16 +0530
> From: Manoj Dandge <[EMAIL PROTECTED]>
> Reply-To: Tomcat Developers List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> 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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to