简体   繁体   English

强制小程序仅加载一次

[英]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. 我需要保持一个applet的加载状态,并避免每次用户访问嵌入了applet的页面时都必须重新加载它。

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. 实际上,我只需要一次调用init()方法一次,就我而言,它是在每次页面重新加载时都调用一次。

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. 如果要保留参数,则必须设置一个cookie。

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

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