hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Sutton <adr...@intencha.com>
Subject Re: problem with applet to j2ee session handling
Date Tue, 03 Feb 2004 20:00:42 GMT
Hi Kamal,

> Connecting an applet to a servlet via an http connection works fine if i use
> the java.net package using getCodeBase().openConnection(). I dont need to
> specify anywhere the session id (which i dont know how to get).
> But if i do the same via a GetMethod of httpclient, it doesnt work, my
> connection is redirected to the login page. I guess that I need to get the
> j2ee session id somewhere and give it (as a header ?) to the http method
> before execution...
> Does anyone have an idea about how it should go ?

J2EE sessions are stored either as a parameter in the URL or as a cookie.
In this case it sounds like it's in a cookie which on IE for Windows will
automatically be sent back when using the standard URL classes.  For
HttpClient and most other systems you have to manually send the cookie
yourself.  You can retrieve it using javascript with document.cookie and
then pass it in to the applet as a parameter which can then be passed
through to HttpClient.

I believe Matt Drance from Apple has polished up these instructions for me
and posted them as a FAQ somewhere on Apple's site so it's probably worth
doing a bit of a dig around there for more info.  If you can't find it and
need more help I can do up some example code for you.

> Kamal El Bedraoui


Adrian Sutton.

Intencha "tomorrow's technology today"
Ph: 38478913 0422236329
Suite 8/29 Oatland Crescent
Holland Park West 4121
Australia QLD

To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org

View raw message