aspose file tools*
The moose likes Java in General and the fly likes How to open an HTML file from an applet both of which are inside a JAR file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

How to open an HTML file from an applet both of which are inside a JAR file?

Shashi Kanta
Ranch Hand

Joined: May 08, 2002
Posts: 89
Hi,
This question has been asked many times on this site and at some other java resource sites.
Taking help from the replies posted, I have used the getResource() method of the ClassLoader class.
The HTML file is "abc.html"
The url obtained is "loaderresource://Z/CRWSbHlp.html" which the browser cannot display!! The standard error "The page canot be displayed" screen was displayed.
My code is as follows :


Another method I tried out was with the following code:



Both the outputs of the url in the java console as well as in the url window is :
loaderresource://Z/abc.html

I have tested the code both from a local pc as well as a webserver.
in the case of the web server, the url in the url window is blank, though the url obtained in the java console is the same as above.
I would appreciate if anyone could point out any mistake in my code or offer an alternative.
Thanks,
Shashi
p.s.: sorry for posting this topic in more than one forum, but I needed a solution by all means!!
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Please do not cross post. Please find the conversation here.


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to open an HTML file from an applet both of which are inside a JAR file?
 
Similar Threads
finally { } clause in Exceptions
How to open an HTML file from an applet both of which are inside a JAR file?
send data to jsp from swings
Opening an HTML file from an applet, both of which are in a JAR file
how to read file into applet in weblogic server