简体   繁体   English

Mac OS X中的Applet生命周期

[英]Applet lifecycle in Mac OS X

I have two applets A and B. They are embedded in separate pages. 我有两个小程序A和B。它们分别嵌入在不同的页面中。 On destroy, A serializes objects to the local file system. 销毁时,A将对象序列化到本地文件系统。 On init, B deserializes these objects. 在初始化时,B反序列化这些对象。 This set-up works fine in Windows. 此设置在Windows中工作正常。 Unfortunately, I have discovered that it doesn't work in Mac OS X. This is because B is initialized before A is destroyed. 不幸的是,我发现它在Mac OS X中不起作用。这是因为B在A被销毁之前已初始化。 Does anyone know if there is some applet param or setting or configuration or work-around that will allow the Mac OS X Java plug-in to behave similar to the Windows one? 有人知道小程序参数,设置或配置或变通办法是否可以使Mac OS X Java插件的行为类似于Windows插件?

Browser: FF 3.0 OS: Mac OS X 10.4 Java plug-in version: 1.5.0_06 浏览器:FF 3.0操作系统:Mac OS X 10.4 Java插件版本:1.5.0_06

You are just lucky that this has been working under Windows, and even on Windows, the behaviour is probably browser specific. 您很幸运,它在Windows下一直有效,甚至在Windows上,该行为也可能是特定于浏览器的。 According to the API documentation, the applet's stop method will be invoked 'when the Web page that contains this applet has been replaced by another page' and the destroy method will be invoked after the stop method. 根据API文档,“当包含此applet的网页已被另一个页面替换时,将调用applet的stop方法”,并在stop方法之后调用destroy方法。 Note the 'when ... has been' and not 'before ... will be'. 注意“何时……已经”而不是“……将会……之前”。 Short summary, if you replace an HTML page with applet A with an HTML page with applet B, the applet API provide no way to make sure that some method of applet A is invoked and completed before applet B is intiialized or started. 简短的摘要,如果您用Applet A替换HTML页面,而将Apple A替换为HTML页面,则applet API无法提供确保在初始化或启动applet B之前调用和完成applet A的某些方法的方法。

If you enable scripting of your applet, you have however implement a kind of save method in applet A and invoke this method using Javascript from page A, before even trying to load page B. 如果启用小程序的脚本编写,则您已经在小程序A中实现了一种保存方法,并使用页面A中的Javascript调用了此方法,甚至试图加载页面B。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM