You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Jeroen Kransen (DT)" <kr...@holmes.nl> on 2005/11/01 10:06:05 UTC

HttpClient and Applets

Hello, 

I have an applet that has to communicate with the originating server
through HTTP. It has to send and retrieve custom data, through GETs and
(if possible) POSTs. I am using HttpClient (I am open for suggestions on
that), which works well in a direct connection. However, when I am
behind a proxy, I get a AccessControlException. I could explain this by
the fact that the proxy server is not the originating server, and that
by specification I am only allowed to contact the originating server.
But I really don't want to bother about things like proxies at all. What
I really want is that the Applet transparently hooking on to the browser
settings for the proxy. The only possibilities I see now to contact the
originating server Applet-wise is through Applet.getAudioClip(),
.getImage(), .getAppletContext().showDocument(), but none of this is
what I want.

I'm sure I'm not the only one who wants to do something like this.
There's probably either a simple solution or it's just plain impossible.
I hope to hear it either way.

Jeroen Kransen

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


Re: HttpClient and Applets

Posted by Paul Libbrecht <pa...@activemath.org>.
My 2p: one very common access error over http in applets is that  
host-names don't match exactly...

paul


Le 2 nov. 05, à 12:34, Oleg Kalnichevski a écrit :

> The AccessControlException is thrown by the AccessController to
> indicate that a requested access (to a critical system resource such as
> the file system or the network) is denied. This problem has nothing to
> do with HttpClient
>
> You may want to take a look at the classes (below) to see how
> a (limited) proxy setting auto-detection could be implemented:
>
> http://svn.apache.org/repos/asf/jakarta/commons/proper/httpclient/ 
> trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/
>
> Hope this helps

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


Re: HttpClient and Applets

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, Nov 01, 2005 at 10:06:05AM +0100, Jeroen Kransen (DT) wrote:
> Hello, 
> 
> I have an applet that has to communicate with the originating server
> through HTTP. It has to send and retrieve custom data, through GETs and
> (if possible) POSTs. I am using HttpClient (I am open for suggestions on
> that), which works well in a direct connection. However, when I am
> behind a proxy, I get a AccessControlException. I could explain this by
> the fact that the proxy server is not the originating server, and that
> by specification I am only allowed to contact the originating server.
> But I really don't want to bother about things like proxies at all. What
> I really want is that the Applet transparently hooking on to the browser
> settings for the proxy. The only possibilities I see now to contact the
> originating server Applet-wise is through Applet.getAudioClip(),
> .getImage(), .getAppletContext().showDocument(), but none of this is
> what I want.
> 
> I'm sure I'm not the only one who wants to do something like this.
> There's probably either a simple solution or it's just plain impossible.
> I hope to hear it either way.
> 
> Jeroen Kransen
> 

Jeroen,

The AccessControlException is thrown by the AccessController to
indicate that a requested access (to a critical system resource such as
the file system or the network) is denied. This problem has nothing to
do with HttpClient

You may want to take a look at the classes (below) to see how
a (limited) proxy setting auto-detection could be implemented:

http://svn.apache.org/repos/asf/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/

Hope this helps

Oleg

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

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