简体   繁体   中英

Don't reset applet on ajax

We have JSF 2.0 (primefaces) application with applet included in web page. Something like this.

<h:panelGroup id="appletbox" layout="block">
<applet id="termApplet" code=com.foo.TermApplet archive=...>
         <param name=... value=... />
</applet>
</h:panelGroup>

The applet is SSH terminal emulation and opens a connection. We call it in com.foo.TermApplet - there is a public void method openFrameFromWebPage(String host) which is called from javascript:

function openTerminal(host) {
   var termApplet = document.getElementById("termApplet");
   termApplet.openFrameFromWebPage(host);

}

This works just fine. The problem is, everytime the web page this applet is included to makes request (including ajax) - it causes the applet to reset and start from scratch.

Would I would like to do, is somehow exclude the applet from postback. Imagine that you are editing some file in vim in the terminal and click a radio button on web page to different data about the work you must do on the server - and it reset the connection and you loose all unsaved data.

Is there a way how to overcome this?

popup another browser with do not close warning and open the applet inside it. If the browser is not refreshing and you are doing only ajax, add an iframe and open the applet from it.

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