如何启动动态工程java,如何使用动态参数启动Java Web Start应用程序

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.

解决方案

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!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值