Applet to Applet comms from Jar Applets
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Simon_Vicary
Posted On:   Friday, April 6, 2001 07:23 AM

I've got Applet to Applet comms working using a static data class which holds references to all applets created and registered with the static data class. This works fine if boths applets are loaded using the CODE' element of the Applet tag. When I try to load the Applets using Jar files (using ARCHIVE=...), then the static data class which holds the applet handles/references seems to fail. The static data class which holds the Applet references, is not part of either JAR file. It is simply referenced by each of the JAR applet bundles, therefore should only be loaded once into the Browsers VM. Again, if I don't JAR the applets, then all works fine. Once jarred, there seems to be multiple in   More>>

I've got Applet to Applet comms working using a static data class which holds references to all applets created and registered with the static data class.


This works fine if boths applets are loaded using the CODE' element of the Applet tag.


When I try to load the Applets using Jar files (using ARCHIVE=...), then the static data class which holds the applet handles/references seems to fail. The static data class which holds the Applet references, is not part of either JAR file. It is simply referenced by each of the JAR applet bundles, therefore should only be loaded once into the Browsers VM.

Again, if I don't JAR the applets, then all works fine. Once jarred, there seems to be multiple instances of the static data class.

Anybody any ideas ? Otherwise the advantages of JAR files are taken away (fewer http requests, and compressed classes)

Thanks

Simon Vicary

   <<Less

Re: Applet to Applet comms from Jar Applets

Posted By:   catfink_catfink  
Posted On:   Tuesday, May 1, 2001 05:04 PM

Try placing the static class in the jar file. If you are seeing multiple instances of the static class, then perhaps they are not running in the same environment. Make sure your archive parameters are identical, otherwise the applets won't be able to register with the same static class. i.e. archive="jar1,jar2,jar3" Also, make sure your codebase for the applets are the same. I've run into lots of quirks getting this to work, but it does, so if you have any other questions, i might be able to help out.

=^..^=

Re: Applet to Applet comms from Jar Applets

Posted By:   John_Zukowski  
Posted On:   Saturday, April 7, 2001 08:55 PM

I can't tell from your question, but are the applets in different JARs?


They must be loaded by the same classloader. Each JAR is in its own space.

About | Sitemap | Contact