在 jnlp 文件上传递参数
是否可以在 JNLP 文件上传递类似 Maven 的参数?
<jnlp spec="1.0+" codebase="${javafxCodebase}" href="Foo.jnlp">
<information>
<title>${javafxTitle}</title>
<vendor>${javafxVendor}</vendor>
...
</information>
...
</jnlp>
如果是这样,谁将这些数据传递到 jnlp 文件?我想到的是:
http://localhost:8080/Foo.jnlp?javafxCodebase=bar&javafxTitle=baz
Is it possible to pass maven-like arguments on a JNLP file?
<jnlp spec="1.0+" codebase="${javafxCodebase}" href="Foo.jnlp">
<information>
<title>${javafxTitle}</title>
<vendor>${javafxVendor}</vendor>
...
</information>
...
</jnlp>
And if so, who will pass these data to the jnlp file? What comes to mind is:
http://localhost:8080/Foo.jnlp?javafxCodebase=bar&javafxTitle=baz
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Java Webstart 不提供对此开箱即用的支持。有一个JNLP Download Servlet但是它仅支持有限的宏集,并且不能包含任何用户定义的宏。
我认为最好的方法是使用像 Velocity 这样的模板引擎编写自己的 servlet 来生成 JNLP 文件即时并用您所需的参数填充它。
There is no support for this out of the box with Java Webstart. There is a JNLP Download Servlet but it only supports a limited set of macros and cannot have any that are user defined.
I think your best approach would be to use a templating engine like Velocity to write your own servlet for generating the JNLP file on the fly and populating it with your required arguments.
您还可以在此网站上尝试 php 脚本。
我发现自动检测我的代码库 url 很有用,因为我需要在不同的服务器上部署 jnlp 文件。
You can also try the php script on this website.
I found it useful to automatically detect my codebase url, since I had a requirement to deploy the jnlp files on different servers.