relative applet location causes problems on local disk

Discussion in 'Java' started by Xah Lee, Apr 22, 2004.

  1. Xah Lee

    Xah Lee Guest

    i have a java applet, where the html file contains the line:
    <APPLET ARCHIVE="../a/live.jar" CODE="Live.class" WIDTH=650 HEIGHT=650
    ALIGN=LEFT>
    where the jar archive location is specified by relative path outside
    the dir html is in.

    everything works fine except it doesn't work if it is on my local
    disk. (gives errer related to permission or applet not found)

    On local disk, it works if i move the live.jar under the dir html is
    in. (and change the archive location accordingly)

    does anyone know what's wrong with this?

    if run under Mac's Safari browser, it works in local disk as well.

    here's the applet in question.
    http://xahlee.org/surface/moebius_strip/moebius_strip_lg1.html

    thanks.

    Xah

    http://xahlee.org/PageTwo_dir/more.html
     
    Xah Lee, Apr 22, 2004
    #1
    1. Advertising

  2. On 21 Apr 2004 17:08:35 -0700, Xah Lee wrote:

    > i have a java applet, where the html file contains the line:
    > <APPLET ARCHIVE="../a/live.jar" CODE="Live.class" WIDTH=650 HEIGHT=650
    > ALIGN=LEFT>


    I suspect you need to set the
    'codebase' higher up the chain,

    codebase='..'
    code='Live.class'
    archive='a/live.jar'

    BTW - it would not coincidentally
    be rge same applet I am using fo this page
    would it?
    <http://www.1point1c.org/model/index.jsp>

    LiveGraphics3D?

    What's your URL?

    And while we are here, please do not cross-post
    <http://www.physci.org/codes/javafaq.jsp#xpost>
    and avoid invalid groups like
    'comp.lang.java.misc' (Yes, yes, I know your
    server carries it, that does not make it valid)

    F'Ups set to c.l.j.programmer, since I think
    this problem has far more to do with basic
    applet parameters than anything 3D..

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, Apr 22, 2004
    #2
    1. Advertising

  3. Xah Lee

    Xah Lee Guest

    the problem is solved by changing the line

    <APPLET ARCHIVE="../a/live.jar" CODE="Live.class" WIDTH=650 HEIGHT=650>

    to

    <APPLET CODEBASE="../" ARCHIVE="live.jar" CODE="Live.class" WIDTH=650 HEIGHT=650>

    and moving the live.jar one dir up.

    note that the following doesn't work:
    <APPLET CODEBASE="../a/" ARCHIVE="live.jar" CODE="Live.class" WIDTH=650 HEIGHT=650>

    my guess is that browers has some security issue of accessing local files.

    PS Thanks Andrew Thompson for help. (Yes, LiveGraphics3D)

    Xah

    http://xahlee.org/PageTwo_dir/more.html
     
    Xah Lee, May 3, 2004
    #3
    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. Jas Shultz
    Replies:
    0
    Views:
    951
    Jas Shultz
    Dec 3, 2003
  2. Xavier Osa
    Replies:
    0
    Views:
    639
    Xavier Osa
    Jan 9, 2004
  3. =?Utf-8?B?VG9ueSBBYmF0ZQ==?=

    Relative Location for Inherits Property

    =?Utf-8?B?VG9ueSBBYmF0ZQ==?=, Nov 9, 2005, in forum: ASP .Net
    Replies:
    10
    Views:
    701
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Nov 10, 2005
  4. Gary
    Replies:
    2
    Views:
    492
    Richard
    Jul 4, 2003
  5. Replies:
    12
    Views:
    523
    santosh
    Nov 15, 2006
Loading...

Share This Page