How to launch a Java Web start application with dynamic parameters

夙愿已清 提交于 2019-12-25 09:06:56

问题


I'm trying to migrate a Java applet to a Java web start application. The applet was activated from a JavaScript with several parameters, some are not hard-coded (sessionId, tempFilePath):

deployJava.runApplet(attributes, parameters);

In order to migrate the applet I'm using a simple JNLP file with applet-desc tag. And from the JavaScript I call:

deployJava.launchWebStartApplication('$jnlp_path');

I just can't understand how to pass to the web start application the parameters that were created by the JavaScript.


回答1:


OK, so it turns out that using deployJava.launchWebStartApplication(...) triggers security restrictions in Chrome and IE.
What I did is kind of work around: I sent an HTTP request to my server and the server's response was a JNLP content.
On the server side, I edited the JNLP on runtime and each time I inserted the required parameters.
When the browsers receive the JNLP content they trigger the download of the required jar.
And that's it!



来源:https://stackoverflow.com/questions/37508597/how-to-launch-a-java-web-start-application-with-dynamic-parameters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!