且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JNLP不会自动更新JAR文件

更新时间:2023-10-03 18:19:28

如果您下载了jnlp

If you download the jnlp spec and look at chapter 6, there is a whole section about caching: "6 Downloading and Caching of Resources"

您可以尝试将版本号添加到jar文件中,然后使用jnlp jar版本属性.

You can try to add a version number to your jar file and then use the jnlp jar version attribute.

如果您当前不执行此操作,则规范会规定以下内容:

If you currently don't do that, the spec states the following:

必须找到使用基本下载协议下载的条目 根据URL在缓存中.从HTTP获得的时间戳 回复的Last-Modified标头字段中的GET请求应为 与下载的资源一起存储.时间戳用于 确定服务器上的副本是否较新.

An entry downloaded using the basic download protocol must be located in the cache based on the URL. The time stamp obtained from the HTTP GET request in the Last-Modified header field of the reply should be stored along with the downloaded resource. The time stamp is used to determine if the copy on the server is newer.

JNLP客户端不能假定HTTP GET请求将返回 每个请求都使用相同的JAR文件. JNLP客户端必须定期 检查Web服务器以查看是否有更新的版本.这 建议在执行应用程序之前执行检查 已启动,但JNLP客户端使用的确切算法取决于 特定的实现.例如,如果JNLP客户端离线, 不需要执行检查.

The JNLP Client cannot assume that the HTTP GET request will return the same JAR file for each request. The JNLP Client must periodically check the Web server to see if an updated version is available. This check is recommended to be performed before an application is launched, but the exact algorithm used by a JNLP Client depends on the particular implementation. For example, if a JNLP Client is offline, the check is not required to be performed.

以上缓存规则也适用于下载的扩展描述符 使用扩展下载协议,其中version属性为 未指定.

The above caching rules also apply to extension descriptors downloaded using the extension download protocol where the version attribute is not specified.