Applet and showdocument() from local file system

Discussion in 'Java' started by migut, Oct 17, 2005.

  1. migut

    migut Guest

    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.
    migut, Oct 17, 2005
    #1
    1. Advertising

  2. migut wrote:
    > 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????


    --
    "Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')
    Thomas Fritsch, Oct 17, 2005
    #2
    1. Advertising

  3. Thomas Fritsch wrote:
    > migut wrote:

    ....
    >> 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'..
    Andrew Thompson, Oct 17, 2005
    #3
  4. migut

    Roedy Green Guest

    On Mon, 17 Oct 2005 17:49:46 +0200, "migut" <mr_q@REM0\/3-THlSwp.pl>
    wrote or quoted :

    >'file://c:/test.html'.


    try this form:

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

    you are missing one /
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
    Roedy Green, Oct 17, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BW
    Replies:
    12
    Views:
    3,642
  2. pcouas
    Replies:
    0
    Views:
    550
    pcouas
    Jun 9, 2006
  3. pcouas
    Replies:
    0
    Views:
    353
    pcouas
    Jun 9, 2006
  4. pcouas
    Replies:
    0
    Views:
    353
    pcouas
    Jun 9, 2006
  5. pcouas
    Replies:
    13
    Views:
    3,643
    Andrew T.
    Jun 23, 2006
Loading...

Share This Page