Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

Applet and showdocument() from local file system

Thread view: 
migut - 17 Oct 2005 16:48 GMT
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.
Thomas Fritsch - 17 Oct 2005 17:31 GMT
> 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.

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

Signature

"Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')

Andrew Thompson - 17 Oct 2005 18:13 GMT
...
>> 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.

showDocument started less than reliable, and is now effectively
useless.  Thank the advertisors that love 'pop-ups', for that.
<http://groups.google.com/group/comp.lang.java.programmer/msg/fd45163fc01cdf59>
(chase the links vack to the thread..)

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

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'..
Roedy Green - 17 Oct 2005 22:16 GMT
>'file://c:/test.html'.

try this form:

file://localhost/C:/mydir/myfile.txt

you are missing one /
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.