Hello Sanjeev,

> My requirement is, to follow the hyper-link present in the response html
> (Welcome/Home Page). I mean i want to click on test-hyper-link and get the
> response.
> 
> Is there any way to do this ?

You've got the page. Scan it for the hyperlink to get the new URL.

> Link URL on Welcome Page:
> https://abcdev.test.com/ABCProject/servlet/PageDirector?choice=upload&userRole=ABCUser

That link looks so static you can probably hard-wire it into your application.

> It can be Get Method or Post Method in real scenario.

How is that? It's either the action attribute of a form, then the FORM says
which one it is. Or it is not in a form, then it is a GET request. If the
same URL is accessed both ways, then the server doesn't care which one it is.

> Our current understanding is we have to use same method which we used for
> first request/login.

If you mean "method object", then you are wrong. HttpClient method objects
can not be re-used, or at least should not. There were some methods for
re-using, but it is rather pointless to try. Just create a new one.

> Becuase it is storing the actual connection and session.

The connection is kept in the method so you can release it when you're
done with the response. The connection manager will try to keep the
connection alive for the next request, but that is strictly a performance
optimization.
The session is in no way related to a connection. Session cookies are stored
in the HttpState. If you didn't create an extra HttpState, the default state
in the HttpClient will be used.

I recommend that you create a new method object to access the second link,
and execute it with the same HttpClient object as the first one. Don't
forget to release the connection after each request, but not before you're
done with reading the response.

hope that helps,
  Roland

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to