views:

372

answers:

1

pseudo code

service(..){


//httpclient get http://www.facebook.com


}

the above is pseudo code for java servlet, when user call this servlet service(..) from browser repeatly

for instance
1. call http://localhost:8080/callService?url=facebook.com/index.php
2. call http://localhost:8080/callService?url=facebook.com/editprofile.php

can these subsequent request using the same "session" ?

+2  A: 

Checkout HttpState class to handle cookie and session. Here is the sample code.

Adeel Ansari
the example show sending cookie to remote server. can you elaborate more how to use this
cometta
There are two ways of maintaining session, cookies and url re-writing. The example mentioned, is showing the use of cookies. For a hint you can look for JSESSIONID, cookie name in the example.
Adeel Ansari