relative applet location causes problems on local disk

X

Xah Lee

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
(e-mail address removed)
http://xahlee.org/PageTwo_dir/more.html
 
A

Andrew Thompson

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..
 
X

Xah Lee

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
(e-mail address removed)
http://xahlee.org/PageTwo_dir/more.html
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top