New Applet Restriction?

R

Roedy Green

In an unsigned applet, let us say my web page lives in:

mindprod.com/projects

let us say my jar lives in

mindprod.com/applets

My jar can read files off my server in


mindprod.com/projects

or

mindprod.com/projects/snippets

but it cannot look in

mindprod.com/jgloss/snippets

In other words Applets may read files only downstream in the directory
tree, not from where the jar is, but from the web page that invoked
it. This is a royal pain. My applet might want to look at a sibling
directory like:

mindprod.com/images

It seems to me this was not always so. Is this something new with JDK
1.5??

Was no the original restriction an Applet could look anywhere on its
OWN website, but not anyone else's without signing?

TO comply you must duplicate files for the applet in each web page
tree that uses it. PHHT! as Bill the Cat would say.

sometimes you can't pack everything into the jar where it is always
available.

--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
 
R

Roland

In an unsigned applet, let us say my web page lives in:

mindprod.com/projects

let us say my jar lives in

mindprod.com/applets

My jar can read files off my server in


mindprod.com/projects

or

mindprod.com/projects/snippets

but it cannot look in

mindprod.com/jgloss/snippets

In other words Applets may read files only downstream in the directory
tree, not from where the jar is, but from the web page that invoked
it. This is a royal pain. My applet might want to look at a sibling
directory like:

mindprod.com/images

It seems to me this was not always so. Is this something new with JDK
1.5??

Was no the original restriction an Applet could look anywhere on its
OWN website, but not anyone else's without signing?

TO comply you must duplicate files for the applet in each web page
tree that uses it. PHHT! as Bill the Cat would say.

sometimes you can't pack everything into the jar where it is always
available.
IIRC you asked a few weeks ago the same question. As a answered then and
I just verified it again using an unsigned and jarred applet, my applet
can access resources anywhere in the doc hierarchy on the same server
(though I tested on localhost) using:
URL resourceToAccess = new URL( getDocumentBase(), absOrRelPath ) );
URLConnection urlc = resourceToAccess.openConnection();
InputStream is = urlc.getInputStream();

Which version of JRE are you running?

Can you show us your code?
--
Regards,

Roland de Ruiter
` ___ ___
`/__/ w_/ /__/
/ \ /_/ / \
 
N

Nigel Wade

Roedy said:
In an unsigned applet, let us say my web page lives in:

mindprod.com/projects

let us say my jar lives in

mindprod.com/applets

My jar can read files off my server in


mindprod.com/projects

or

mindprod.com/projects/snippets

but it cannot look in

mindprod.com/jgloss/snippets

In other words Applets may read files only downstream in the directory
tree, not from where the jar is, but from the web page that invoked
it. This is a royal pain. My applet might want to look at a sibling
directory like:

mindprod.com/images

It seems to me this was not always so. Is this something new with JDK
1.5??

Applets don't read files from the server directory structure, they request
URLs from the http server. Are you sure that your webserver is actually
serving the URL you are requesting from the applet?

What does the error log file for the web server show you actually tried to
access, and the reason for failure?
 

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

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top