How can an applet get information about the URL it was called from?

John Zukowski

The getDocumentBase() method of Applet returns the base URL of the HTML file that loaded an applet. It is frequently used in conjunction with getting supplemental files like images, as in Image image = getImage(getDocumentBase(), "foo.gif");

While in most cases it returns the full URL of the HTML file that loaded the applet, the API docs specify that it only needs to return the URL for the directory of the file.