On Wed, 2006-08-09 at 15:41 +0800, leung cc wrote:
> Ah, finally it's all working. I can now use either the GetMethod or the
> PostMethod to communicate with my servlet. When I used GET I coded the
> jsessionid thing wrong - should have written ";jsessionid=..." but instead
> I had it as "?jsessionid=...". If I use the PostMethod, I needed to send a
> cookie to the server telling it the session I wanted.
>
You could have just seeded the initial HTTP state with the session
cookie to achieve the same net result for all requests (GET, POST, etc)
HttpClient httpclient = new HttpClient();
String sessionId = "whatever";
Cookie cookie = new Cookie(
"www.blahblah.com.hk", "JSESSIONID", sessionId);
cookie.setPath("/");
cookie.setSecure(true);
httpclient.getState().addCookie(cookie);
Oleg
> But of course, whether I will have the dreaded "Connection timed out:
> connect" problem which opened up this can of worm for me in the first place
> remains to be seen. I hope the following code had extended the connection
> time out period and I will never get a timeout again:
>
> HttpClient httpClnt = new HttpClient();
> httpClnt.getParams().setParameter( "http.socket.timeout", new Integer(
> 60000 ) );
> httpClnt.getHttpConnectionManager().getParams().setConnectionTimeout( 30000
> );
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]