Return-Path: Delivered-To: apmail-jakarta-httpclient-user-archive@www.apache.org Received: (qmail 43801 invoked from network); 9 Aug 2006 08:27:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Aug 2006 08:27:34 -0000 Received: (qmail 90384 invoked by uid 500); 9 Aug 2006 08:27:34 -0000 Delivered-To: apmail-jakarta-httpclient-user-archive@jakarta.apache.org Received: (qmail 90367 invoked by uid 500); 9 Aug 2006 08:27:33 -0000 Mailing-List: contact httpclient-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: "HttpClient User Discussion" Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-user@jakarta.apache.org Received: (qmail 90356 invoked by uid 99); 9 Aug 2006 08:27:33 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Aug 2006 01:27:33 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [195.186.19.66] (HELO mail22.bluewin.ch) (195.186.19.66) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Aug 2006 01:27:33 -0700 Received: from [192.168.0.2] (83.78.147.89) by mail22.bluewin.ch (Bluewin 7.3.110.2) id 449255C700A99918 for httpclient-user@jakarta.apache.org; Wed, 9 Aug 2006 08:27:12 +0000 Subject: Re: can I NOT have the cookie please From: Oleg Kalnichevski To: HttpClient User Discussion In-Reply-To: References: Content-Type: text/plain Date: Wed, 09 Aug 2006 10:27:11 +0200 Message-Id: <1155112031.4960.7.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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: httpclient-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: httpclient-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpclient-user-help@jakarta.apache.org