Avoiding applet destroy() being called in Netscape 7.x
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Gil_Bregman
Posted On:   Wednesday, April 2, 2003 10:11 AM

I have an applet which I run both in Netscape 4.x using the internal Java 1.1 VM and Netscape 6.x/7.x using different versions of Java 2. When using Netscape 4.x, navigating away from my applet page causes Netscape to call the applet stop() method, pressing the "Back" button calls the start() method. But, when running in Netscape 7.x using Sun's Java 1.4.1_02 plugin, the destroy() method is called when going to a different page. The result is all my resources are destroyed and the sockets are closed. Going back to the page triggers the init() method but by now my session is lost. Trying to ignore and do nothing in the destroy() method didn't help. Is there any way to change the behavior of Netscape 7.x (or is Sun's plugin?) not to destroy the app   More>>

I have an applet which I run both in Netscape 4.x using the internal Java 1.1 VM and Netscape 6.x/7.x using different versions of Java 2. When using Netscape 4.x, navigating away from my applet page causes Netscape to call the applet stop() method, pressing the "Back" button calls the start() method. But, when running in Netscape 7.x using Sun's Java 1.4.1_02 plugin, the destroy() method is called when going to a different page. The result is all my resources are destroyed and the sockets are closed. Going back to the page triggers the init() method but by now my session is lost. Trying to ignore and do nothing in the destroy() method didn't help.


Is there any way to change the behavior of Netscape 7.x (or is Sun's plugin?) not to destroy the applet when going to a different page?

   <<Less

Re: Avoiding applet destroy() being called in Netscape 7.x

Posted By:   Russell_Scheerer  
Posted On:   Friday, May 9, 2003 11:40 AM

just enter an infinite loop...




public void destroy() {
boolean isJava2;
//Set isJava2 variable

while(isJava2) {
try {
Thread.sleep(3000);
}catch(Exception e) {}
}

//Should never get here if running Java2
super.destroy();
}



h
This seems to work for all browsers except NS7 on Mac OS X it seems that it will destroy the applet no matter what, but this does work on Windows.
About | Sitemap | Contact