commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Libbrecht <>
Subject Re: [HttpClient] Using httpclient in applets (includes dirty fix)
Date Thu, 05 Dec 2002 15:14:55 GMT

On Jeudi, d├ęcembre 5, 2002, at 03:50 , Joel Palmius wrote:

> Attached is a quick and dirty fix for making HttpClient work in 
> applets. I
> simply commented out the getProperties() calls and replaced them with
> setting the appropriate string to what was earlier in the default value
> part of the call. With the patch applied this code works in a JApplet:
>   String docbase = this.getDocumentBase().toString();
>   URL url = new URL(docbase);
>   String host = url.getHost();

This raises a funny question: is there a way for a library being called 
from an applet to test wether it's in an applet ? I would do it 
precisely with System.getProperties() catching the exception but there 
should be a cleaner way !


View raw message