hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keith Campbell <keithcampb...@mac.com>
Subject Re: multiple instances of httpclient
Date Thu, 18 Aug 2005 23:47:47 GMT
Hi again,

I think I may have answered my question but please tell me if I'm on  
the right track or not ....

I  think I can maintain multiple user sessions using one instance of  
HttpClient if I do something like the following:

Maintain one instance of HttpClient for all users.

Support multiple users by getting the HttpState and storing Cookies  
to each user's session.

So ... for each session, first thing to do is get the cookies from  
the session if there are cookies there, clear any existing cookies  
from the HttpState, set the cookies from the session to the  
HttpState, execute the get or post, retrieve the cookies from the  
HttpState and set them again in the user session.

Is this the correct way to go about doing what I want to do?

Keith

On Aug 18, 2005, at 6:59 PM, Keith Campbell wrote:

> Hi all,
>
> A quick question for the list please. I've been struggling with  
> this for a couple of days now w/o much success.
>
> I have a servlet which is used to send requests (using HttpClient)  
> to another web application where:
>
> 1) each user must login -- each user logs in using GET by passing a  
> user id as a parameter
> 2) each user's session must be persistent
> 3) multiple users will be using the application and each must  
> maintain a unique session
>
> To do this, I've been trying to instantiate HttpClient, in my  
> servlet, once per user session. And I'd like to be able to store/ 
> retrieve this instance in the user session. But HttpClient is not  
> serializable ....
>
> How do I accomplish this functionality?
>
> Thanks in advance,
> Keith Campbell
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message