Hi,
I'm new to the list, thanks for any pointers. I'm using HTTPClient from a
jsp, trying to
login to a j2ee web app (localhost). After using PostMethod and providing
the
credentials, I got SC_MOVED_TEMPORARILY to the index page. I used GetMethod
to that redirect location and got 200 OK. So far so good.
My problem is how to redirect to that (index page) location from the jsp.
At that point, I'm already authenticated. I tried
response.sendRedirect(redirectLocation)
but the browser displays the login page. If I display the response body, I
got HTTP 404
on some links (of the web app) since they are visible to the jsp context. I
tried to set
setFollowRedirects(true) without success.
...(jsp code)
HttpURLConnection urlConnection = new HttpURLConnection(authpost, url);
if (urlConnection.getResponseCode() == HttpStatus.SC_MOVED_TEMPORARILY) {
String indexPage = authpost.getResponseHeader("location").getValue();
GetMethod redirect = new GetMethod(indexPage);
//redirect.setFollowRedirects(true);
client.executeMethod(redirect);
//what's next?
//response.sendRedirect(indexPage);
//out.println(redirect.getResponseBodyAsString());
}
Please help.
Thanks, Ronald
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]