开发者

Passing arguments on a jnlp file

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜