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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to