Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: on demand loading




On Nov 14, 2007, at 2:51 PM, Adrian Bartholomew wrote:

getCodeBase() and getDocumentBase() is not the same thing. ur applet could be on an entirely different server.
plus, it just doesnt make sense that sun would have 2 doing the same thing.
From <http://java.sun.com/docs/books/tutorial/deployment/applet/ data.html>

______________________

The code base, returned by the JApplet getCodeBase method, is a URL that specifies the directory from which the applet's classes were loaded.

The document base, returned by the JApplet getDocumentBase method, specifies the directory of the HTML page that contains the applet.

Unless the <APPLET> tag specifies a code base, both the code base and document base refer to the same directory on the same server.

Data that the applet might need, or needs to rely on as a backup, is usually specified relative to the code base. Data that the applet developer specifies, often by using parameters, is usually specified relative to the document base.

_______________________

Note that this information is for an applet, running inside of a web page, in the user's web browser. getDocumentBase is only really relevant when that is the case. Perhaps you should try a little basic debugging, and System.out.println the results of these two methods, like:

System.out.println("Document base: " + getDocumentBase());
System.out.println("Code base: " + getCodeBase());

Which should give you a sense of where your applet is currently looking for those resources.
--
Troy
RPSystems, Ltd.
http://www.rpsystems.net



_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: on demand loading (From: Greg Guerin <email@hidden>)
 >Re: on demand loading (From: Joshua Smith <email@hidden>)
 >Re: on demand loading (From: Adrian Bartholomew <email@hidden>)
 >Re: on demand loading (From: Joshua Smith <email@hidden>)
 >Re: on demand loading (From: Adrian Bartholomew <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.