简体   繁体   中英

Force applet to load only once

Here's my situation:

I need to keep an applet loaded, and avoid having to reload it each time the user goes to the page where the applet is embedded.

How can i achieve this? Are there any parameters to set my applet to be singleton? Here are the parameters I'm currently using:

<object id="mockapplet" name="mockapplet"
         classid="java:mockClass"
         type="application/x-java-applet"
         archive="#{myAppletPath}"
         height="1"
         width="1" codebase=".">
    <param name="code" value="mockApplet" />
    <param NAME="MAYSCRIPT" VALUE="true" />
    <param name="archive" value="#archivePath}" />
    <param name="JAVA_CODEBASE" value="." />
    <font color="red">Applet error</font>
</object>

in fact i need init() method to be call only once , in my case it is call each time my page reloads.

well, if your applet is Embedded in your page, you reload it each time you reload the page ! if you want to keep parameters, you have to set a cookie.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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