hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alvin Antony" <Alvin.Ant...@consol.de>
Subject AW: Java plugin 1.4.2 Cookie support URLConnection vs HttpClient
Date Wed, 19 Oct 2005 07:25:49 GMT
Hi Roland,

Thank you for the fast response.
The exception is from server, because I see on the response header that,
the server set a new jsession cookie on it. 

An another question, if I have a cookie parameter from browser via
javascript or what ever....

HttpClient httpclient = new HttpClient();
httpclient.getState().addCookie(
  new Cookie("www.whatever.com", "jsession", "topsecret", 
  "/", -1, false));
GetMethod httpget = new GetMethod("http://www.whatever.com");

Does this work for me? I found this in an old thread, or is there any
other way to set Cookie?

Thanks,

Alvin






alvin.antony@consol.de                     ConSol* Software GmbH
Phone +49-89-45841-191                     Consulting & Solutions
Fax   +49-89-45841-111                     Franziskanerstr. 38
Mobile+49-160-97340713
http://www.consol.de                       81669 M√ľnchen

-----Urspr√ľngliche Nachricht-----
Von: Roland Weber [mailto:ROLWEBER@de.ibm.com] 
Gesendet: Mittwoch, 19. Oktober 2005 07:53
An: HttpClient User Discussion
Betreff: Re: Java plugin 1.4.2 Cookie support URLConnection vs
HttpClient

Hi Alvin,

> As I understood Java plugin supports Cookie support for URLConnection
as
> shown here.
>
http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/cookie_
> support.html
> 
> As there any way in htttpclient to use this option? 

To make it short: No. HttpClient does in no way interact with the
Java Plug-in. You have to establish a new session with the server.
Maybe you can use some JavaScript to pass the required parameters
to the applet, for example the session cookie.
You did not mention where the UnauthorizedException occurs. If it
is on the server, the missing session cookie might be the reason.
If it happens on the client, the reason is the security model in
the browser environment. You have to sign the applet and the JARs
that hold HttpClient to permit some of the things HttpClient does
when initializing or opening a connection.

hope that helps,
  Roland

---------------------------------------------------------------------
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