File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes getDocumentBase() Different results with IE and NN Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "getDocumentBase() Different results with IE and NN" Watch "getDocumentBase() Different results with IE and NN" New topic
Author

getDocumentBase() Different results with IE and NN

raimondas zemaitis
Ranch Hand

Joined: Feb 23, 2001
Posts: 104
Does anyone had similar problem:
I am hosting at www.webappcabaret.com
here's code snip from an applet
try {
System.out.println("URL: " + new URL(getDocumentBase(), "main.htm"));
getAppletContext().showDocument(new URL(getDocumentBase(), "main.htm"));
}
catch(MalformedURLException urlEx) {
urlEx.printStackTrace();
}
System.out here for debugging purposes. Now, with IE
I get output:
"URL: http://www.webappcabaret/main.htm"
while with Netscape I get:
"URL: http://www.webappcabaret/my_context_here/main.htm"
First, I was rather surprised to see this,
Second, even that URL which I get with Netscape is correct one, required
page does not get loaded with the second line, i.e. showDocument(),
Netscape just sits there and does nothing, no error msgs or whatever.
When I construct correct URL for IE, it works just fine.
I use Netscape Communicator 4.7
Any comments, ideas ?
 
 
subject: getDocumentBase() Different results with IE and NN
 
Threads others viewed
Apache/Tomcat Configuration
Host?
Rational Rose Free Copy for students??
www.webappcabaret.com
Web hosting and Java Servlets
IntelliJ Java IDE