# Inter-applets communication between 2 frames

CMARCHAN.US.ORACLE.COM (CMARCHAN@us.oracle.com)
09 Oct 97 14:11:28 -0700

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Jan Luehe: "Re: JCE"
- Previous message: Paul E. Andrighetti: "Migrating ACL implementation to JDK1.2 Security Architecture"

    Message-Id: <199710092216.PAA29634@mailsun2.us.oracle.com>

    Date: 09 Oct 97 14:11:28 -0700

    From: "CMARCHAN.US.ORACLE.COM" <CMARCHAN@us.oracle.com>

    To: java-security@web2.javasoft.com

    Subject: Inter-applets communication between 2 frames

Hi, I have a question about inter-applets communication that reside in
different frames.
I have a browser (see picture below) that:
- loads and HTML page which creates a FRAME (frame1)
- in frame1 another HTML file is loaded
- it creates two frames, frame2 and frame3
- frame2 loads another HTML document which loads and run SourceApplet
- frame3 loads another HTML document which loads and run TargetApplet
+-------------------------------------------+
| Frame 1 |
| +--------------+ +---------------+ |
| | Frame 2 | | Frame 3 | |
| | | | | |
| | | | | |
| | | | | |
| +--------------+ +---------------+ |
| |
+-------------------------------------------+
SourceApplet has a textfield for a user to type. When the text is entered the
textfield, something must send that information to TargetApplet for display.
1- First scenario, we tried to use the applet context. The top level
frame that SourceApplet can get a reference to is frame2, using getApplets,
SourceApplet cannot find TargetApplet.
My understanding is that this is due to the sandbox, where applets can
only know about other applets that live within the same frame, therefore they
can only communicate through the AppletContext with other applets that live in
the same frame.
2- Second scenario. Here's a brief explanation of what we are doing.
We created an abstract class PersistentApplet which extends applet and
implement Observer. It contains a static CLASS variable. This static CLASS
contains a class which extends Observable. Using this it detects new input.
SourceApplet extends PersistentApplet. Using this it can capture new
text typed by the user.
TargetApplet extends PersistentApplet. Using this it can made aware
that text has been changed and display it.
Since PersistentApplet implements s static CLASS variable and both
applets extend PersistentApplet, they both reference the same static CLASS
variable in memory, therefore when the user type some text in SourceApplet in
frame2, the static CLASS variable notifies TargetApplet in frame3 which can
then display the text.
Using this method, we can pass information from an applet in one frame
to another applet in another frame.
My understanding is that it will also work when the two frames (frame2
and frame3) resides in different browsers.
In conclusion, we are wondering if this is legal to do or is this a hole in
the sandbox????
If this is legal to do, then why can't we use AppletContext to find
other applets in other frames?
If this is a hole in the sandbox, then Netscape 4 and MIE 4 both allow
this without any security violation, what do we do at this point? We need to
know it ASAP because this will change our design.
A quick answer will be appreciated.
Thanks,
Claude Marchand
MT Consulting, Inc.
for Oracle Corp.
415 506-6243
PS: If you need more information, feel free to contact me.

- Next message: Jan Luehe: "Re: JCE"
- Previous message: Paul E. Andrighetti: "Migrating ACL implementation to JDK1.2 Security Architecture"