简体   繁体   中英

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&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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM