Applet and showdocument() from local file system

M

migut

Hi,
i created japplet class, which is supposed to launch html page from _local_
system.
so i signed jars and everything, but when i lauch my applet downloaded from
remote server, getAppletContext().showdocument(url) doesn't work if url is a
link to local file, like: 'file://c:/test.html'. when i set url to
'http://sun.com', it works ok.

there is no exception or error code( showdocument returns void), and local
page doesn't load. when i lauch applet from local system, it works correct.

probably codebase is different, so browser ignores it, but how can i avoid
this????

michal.
 
T

Thomas Fritsch

migut said:
i created japplet class, which is supposed to launch html page from _local_
system.
so i signed jars and everything, but when i lauch my applet downloaded from
remote server, getAppletContext().showdocument(url) doesn't work if url is a
link to local file, like: 'file://c:/test.html'. when i set url to
'http://sun.com', it works ok.
Just a guess (don't if it solves your problem):
In an URL the thing behind the "://" is supposed to be the hostname.
Hence in "file://c:/test.html" the host name will be "c:", which is
definitely not what you meant.
You should try
either "file:/c:/test.html" (=> no host name)
or "file:///c:/test.html" (=> again no host name)
there is no exception or error code( showdocument returns void), and local
page doesn't load. when i lauch applet from local system, it works correct.
That is the way it is: showDocument(URL) never throws an exception.
 
A

Andrew Thompson

Thomas said:
migut wrote: ....

That is the way it is: showDocument(URL) never throws an exception.

showDocument started less than reliable, and is now effectively
useless. Thank the advertisors that love 'pop-ups', for that.

Use a (?)Frame/(?)Dialog for any Java bits, and for new pages..
- Don't - HTML was designed/intended to be linear.
- If you absolutely must, ask the end user to accept your
digitally signed code, then run 'BrowserLauncher'..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top