Thankyou for the example! Do you know how I can use this in a servlet so
the servlet forwards a request to a page which is protected with HTTP
Authentication?
Markus
On fredag, februari 22, 2002, at 02:44 , Marot Laurent wrote:
> to get an HTML file, U can try that :
>
> URL url = new URL (path);
> String userPassword = "login:password";
> StringWriter sw = new StringWriter();
> PrintWriter pw = new PrintWriter(sw);
> String encoding = new sun.misc.BASE64Encoder().encode
> (userPassword.getBytes());
> URLConnection uc = url.openConnection();
> uc.setRequestProperty ("Authorization", "Basic " + encoding);
> InputStream content = (InputStream)uc.getInputStream();
> BufferedReader inR = new BufferedReader (new InputStreamReader
> (content));
> while ((ligne = inR.readLine()) != null) { buf.append(ligne + "\n"); }
>
> -----Message d'origine-----
> De : Markus Kirsten [mailto:[EMAIL PROTECTED]]
> Envoy� : mercredi 20 f�vrier 2002 19:15
> � : [EMAIL PROTECTED]
> Objet : Basic HTTP Authentication
>
>
> Does anyone know how to access resources (such as HTML files for
> example) that requires basic HTTP authentication? Which framework to
> use, how to use it or which web page to look at? :-)
>
> Thanks!
>
>
> Markus Kirsten
>
> ________________________________________________________________________
> ___
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html