aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Difference between getDocumentBase() and getCodebase() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Difference between getDocumentBase() and getCodebase() " Watch "Difference between getDocumentBase() and getCodebase() " New topic
Author

Difference between getDocumentBase() and getCodebase()

Mike Liu
Greenhorn

Joined: Jan 24, 2002
Posts: 3
Hi, Can anybody tell me the deffience between getDocumentBase() and getCodeBase().
Thank you.
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
Blatantly copied from javadoc...
getDocumentBase()
Returns an absolute URL naming the directory of the document in which the applet is embedded. For example, suppose an applet is contained within the document:
http://java.sun.com/products/jdk/1.2/index.html

The document base is:
http://java.sun.com/products/jdk/1.2/

getCodeBase()
Gets the base URL. This is the URL of the applet itself.
[ February 20, 2002: Message edited by: Rob Ross ]

Rob
SCJP 1.4
Mike Liu
Greenhorn

Joined: Jan 24, 2002
Posts: 3
Thank you Rob, you know I am kind of new in java, can you give me one example on this. thank you again.
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Mike
Welcome to the Java Ranch, we hope you’ll enjoy visiting as a regular however,
your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!


Dave
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Difference between getDocumentBase() and getCodebase()