我有一个基于JNLP的应用程序,但每次用户单击JNLP文件时,都会发生新的下载,并且文件大于80mb .

我阅读了所有文档,该文件使用DigiCert的信任证书进行签名 .

但是jar文件是一遍又一遍地下载的,但是这有时会在几次执行之后,但应用程序中没有任何变化 .

我们使用oracle建议,如何在文档中描述:

http://docs.oracle.com/javase/7/docs/technotes/guides/javaws/developersguide/syntax.html#update

属性:

check attribute: The check attribute indicates the preference for when the JNLP Client should check for updates, and can have one of the three values: "always", "timeout", and "background"

使用 Value :

A value of "always" means to always check for updates before launching the application.

属性:

policy attribute: The policy attribute indicates the preference for how the JNLP Client should handle an application update when it is known an update is available before the application is launched, and can have one of the following three values: "always", "prompt-update", and "prompt-run

使用 Value :

A value of "always" (default) means to always download updates without any prompt.

我非常怀疑在这个文档的位置“当知道在应用程序启动之前有可用的更新”,他们如何知道应用程序需要更新,以及JNLP是否相同,服务器中的应用程序是同样,为什么他们更新 .

我们也使用oracle recomendation来避免不必要的更新:

https://docs.oracle.com/javase/tutorial/deployment/deploymentInDepth/avoidingUnnecessaryUpdateChecks.html

服务器不是静态内容,JNLP是每次用户需要生成的,但内容是相同的,我们认为这是文件生成的问题,但是当我们使用相同的文件来模拟发送给用户的场景时,他仍然没有下载文件 .

奇怪的是在本地服务器上工作,没有下载 .

我尝试使用版本,代码库,但我不清楚,java使用的参数来确定JNLP中的某些资源何时更新 .

我的JNLP文件:

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.5+" codebase="http://www.orgen.com.br/jnlp">
    <information>
        <title>orgen-client</title>
        <vendor>AtlanticaSoft</vendor>
        <homepage href="http://www.orgen.com.br" />
        <description>Aplicação cliente Orgen</description>
        <icon href="icon.png" kind="default" />
    </information>  
    <update check="always" policy="always" />
    <security>
        <all-permissions />
    </security>  
    <resources>
         <j2se version="1.8+" initial-heap-size="256m" max-heap-size="512m" java-vm-args="-Xms256m -Xmx1024m" />
         <jar href="lib/orgen-client.jar" version="1.0" main="true" />
         <jar href="lib/orgen-client-dependency.jar" version="1.0" />
         <property name="jnlp.versionEnabled" value="true"/>
    </resources>
    <application-desc main-class="br.com.atlanticasoft.orgen.client.Main" />
</jnlp>

我的JNLP动态生成文件 - 在JaNeLa更正后“orgen-client.jnlp”:

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="6.0+" xmlns:jfx="http://javafx.com"    codebase="http://www.orgen.com.br/jnlp">
    <information>
        <title>orgen-client</title>
        <vendor>AtlanticaSoft</vendor>
        <homepage href="http://www.orgen.com.br/"/>
        <description>Aplicação cliente Orgen</description>
        <icon href="icon.jpeg"/>
        <offline-allowed/>
        <shortcut online="true">
            <desktop />
            <menu submenu="My App"/>
        </shortcut>
    </information>
    <security>
        <all-permissions/>
    </security>
    <update check="always"/>
    <resources>
        <j2se version="1.8+" java-vm-args="-Xms256m -Xmx1024m" href="http://java.sun.com/products/autodl/j2se"/>
        <jar href="lib/orgen-client.jar" version="0.0.1-SNAPSHOT" main="true"/>
        <jar href="lib/orgen-client-dependency.jar" version="0.0.1-SNAPSHOT"/>
        <property name="jnlp.versionEnabled" value="true"/>
    </resources>
    <application-desc main-class="br.com.atlanticasoft.orgen.client.Main">

      <argument>tenant_id%3D1</argument>
      <argument>jsfsession%3DQvxSCvhgTKST-VkHtAg_AlnQeqeuXnUhP8_iyIo5</argument>
      <argument>ip%3D34.195.218.69</argument>
      <argument>idunidade%3D1</argument>
      <argument>action%3DImprimirLaudo</argument>
      <argument>idproducaoitens%3D1346</argument>
      <argument>locale%3Dpt_BR</argument>
      <argument>contextroot%3D%2F</argument>
      <argument>imprimirpapeltimbrado%3Dtrue</argument>
      <argument>point%3DproducaoConsulta</argument>
      <argument>idusuario%3D20</argument>

   </application-desc>
</jnlp>