I've got a Java applet that talks to a back-end server. The applet
has a "Start" button that causes it to establish the connection.
The back-end server is NOT the web server that the HTML web page
containing the applet comes from, so the applet JAR file is stored on
the back-end server, and the HTML code references the JAR file by
an absolute URL with that back-end server as the host.
That works fine.
Now we want to replace the GUI presented by the applet with one
implemented in Javascript. The applet itself becomes faceless
(applet tag has width=0 and height=0). The JavaScript calls a
method in the applet to do what the "Start" button did before.
That works fine, *if* the web page and applet are on the same
server. It fails if they are not.
I spent some time trying to figure out why. As near as I can tell,
the problem is that when the JavaScript running in the browser
makes a method call into the applet, even though it is calling
the same method the Start button did, it is calling it from a
different thread.
The Start button is called in a thread that toString re****ts as
"Thread[AWT-EventQueue-4,4,<html-page-url>/-threadGroup]".
The method called by Javascript is in a thread that toString re****ts as
"Thread[Thread-2,5,main]".
Are there really different security policies in place in the applet
based on which thread is running?
Thanks!
Eric


|