Caching and the java applet lifecycle

chris (2002-12-16 18:13:37)
1 replies
Working for the first time with applets - it initially looked like the browser was caching them, so any changes were failing to load in. I tried killing all persistant data - disk cache and memory cache, but to no avail. No number of re-compliations would help either.

So some investigation into the applet lifecycles reveals that:

the class file is loaded into the browser only once and the init() method is called only once. after that, if you move to some other application, then the applet's stop method is called. When you come to the page again, the start method of the applet is called by the browser. the destroy method is called only once i.e. when you close the browser (and all all windows of that browser), then the java class file is not removed from the working memory of the browser.

2002-12-27 12:19:03


Applet persistance in browsers is easily overcome during development by using the appletviewer application instead of wasting time with browers.

reply icon