Code Comments
Programming Forum and web based access to our favorite programming groups.
I have the same problem with sending Authorization and redirecting the
url. Please help.
-Thanks
-Ram
-rgande@gmail.com
marcmnich9876@my-deja.com wrote:
> I'm trying to redirect from a servlet to a page
> that is username/password protected and normally
> pops up a "username and password" window. I want
> to prevent the window from coming up by sending
> the setHeader("Authorization",...) info.
>
> Has anyone got this to work?
>
> Here's what I am using:
>
> String authString = "someusername" + ":"
> + "mypassword";
> String auth = "Basic " +
> new sun.misc.BASE64Encoder
> ().encode(authString.getBytes());
> String bare = new
> sun.misc.BASE64Encoder().encode(authString.getByt\
> es());
>
> response.setHeader("Authorization", auth);
>
> response.sendRedirect
> ("http://www.somedomain.com");
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.