开发者

Passing arguments on a jnlp file

开发者 https://www.devze.com 2023-01-17 15:13 出处:网络
Is it possible to pass maven-like arguments on a JNLP file? <jnlp spec=\"1.0+\" codebase=\"${javafxCodebase}\" href=\"Foo.jnlp\">

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开发者_如何学Go&javafxTitle=baz


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消