Versioning in Java Web Start
does someone know what to spec开发者_如何学Pythonify in the JNLP file so that JARS won't be downloaded all the time, but only when there's a new version on the server side? I know i can specify: version="1.5" for exactly the version 1.5, or version="1.6+" for 1.6 or higher.
Let's take the case of version="1.6+". If the user has version 1.7 a JAR won't be downloaded, even if on the server the JAR keeps updating to 1.8, 1.9 and so on... I want the JAR to be downloaded but only when there's a new version on the server side. Can this be done?
Thanks, Teo
what to specify in the JNLP file so that JARS won't be downloaded all the time, but only when there's a new version on the server side
By default webstart will check if you have the latest version of every jar file referenced in your JNLP. To avoid these often unnecessary checks, you can use the "version download protocol" .
You first need to name your application resources (jars etc) using the following naming convention
<name of jar file>__V<version number>.jar
Next, you need to add the version
attribute to the <jar>
tag and then you version-enable your resources by setting the jnlp.versionEnabled
to true in the JNLP.
This method will ensure that only the outdated jars are updated.
Details are given here
If, however, you do not wish to change your JNLP to modify the version numbers of the jars that have changed, then this option will NOT work for you and you will have to deal with default behavior of the WebStart that checks each an every resource to verify that you have the latest version.
精彩评论