hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ROLWE...@de.ibm.com>
Subject RE: windows authentication problem
Date Fri, 04 May 2007 08:55:38 GMT
Hello Naresh,

>     private void getConnected() throws IOException {
> 
>         HttpClient client = new HttpClient();
>         HttpState state = client.getState();

Keep that state in the HttpSession of the servlet. For future
requests, pass that state to HttpClient.executeMethod(...) or
use HttpClient.setState(...) if there are no multithreading
issues.

>         } finally {
>             // release any connection resources used by the method
>             httpget.releaseConnection();
>         }

You are releasing the connection back to the manager, but
you are not _closing_ it. If you don't plan to re-use the
HttpClient object or it's connection manager, call
HttpConnectionManager.shutdown().

Read the Threading Guide and the Performance Guide first:
http://jakarta.apache.org/commons/httpclient/threading.html
http://jakarta.apache.org/commons/httpclient/performance.html

hope that helps,
  Roland


Mime
View raw message