tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: Manager app and HttpURLConnection
Date Mon, 02 Jun 2003 11:43:10 GMT
That is because the manager servlet is protected. A 401 response code is a 
challenge back to the client and the client needs to resend a new request 
with the Header: WWW-Authenticate with the userid and password. More information:
http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc2068.html#sec-10.4.2

-Tim

Dominic Parry wrote:
> Hi
> 
> I'm trying to do this:
> 
> try {
>          URL url = new URL("http://localhost/manager/reload?path=/DynaServlet");
>    HttpURLConnection con = (HttpURLConnection)url.openConnection();
>    BufferedReader in = new BufferedReader(
>                                 new InputStreamReader(
>                                 con.getInputStream()));
>          String inputLine;
>             while ((inputLine = in.readLine()) != null)
>              out.write(inputLine + "<br>");
>          in.close();
>   } catch (Exception e) {
>    out.write(e.toString()+"<br>");
>   }
> 
> from an HttpServlet. I'm getting:
> 
> java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost/manager/reload?path=/DynaServlet
> 
> even when I change the URL to something like http://user:pass@localhost/manager/reload?path=/DynaServet
I get the same exception.
> 
> Any ideas why?
> 
> Thanks
> 
> Dom


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message