🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #2747

Re: Applet:getCodeBase().getHost() returns null

#2747
From: Trejkaz Xaoza
Date: Wed, 17 May 2000 00:00
18 lines
1177 bytes
Tom Corcoran wrote:
> In order to communicate between an applet and a servlet, I need to obtain
> the value for
> getCodeBase().getHost(), yet it returns null.

This makes sense if the Applet is being run from a local disk. 
getCodeBase()
will then return a 'file' URL, pointing to the local disk, whose
getHost()
method should return null.
For getHost() to return non-null, the Applet would have to be run from a
web
server (tomcat is as good as any, plus you'd be able to run your servlet
there
too), so it would have a 'http' URL, and getHost() would return a
sensible value.

TX
Technical Details
Message-ID: <3921E8EA.52B68402@darker.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <YWDK4.5380$sB3.3561@news.indigo.ie>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,33c3731f9a0bcde5
X-Google-Attributes: gid1089d0,public
From: Trejkaz Xaoza <trejkaz@darker.net>
Subject: Re: Applet:getCodeBase().getHost()  returns null
Date: 2000/05/17
Message-ID: <3921E8EA.52B68402@darker.net>
X-Deja-AN: 624313414
Content-Transfer-Encoding: 7bit
References: <YWDK4.5380$sB3.3561@news.indigo.ie>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.api