JNLP不会自动更新JAR文件 [英] JNLP does not auto updating JAR file

查看:136
本文介绍了JNLP不会自动更新JAR文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这样的环境中工作,我们必须每2个月最多更新一次客户端jar.因此,作为一种解决方案,我建议通过这种方法使用JNLP,我们不必担心每个用户是否都在使用最新版本.如此,每个部门有超过100个客户.

I am working in a such environment, where we have to update client jar in every 2 months maximum. So, as a solution I am suggesting to use JNLP by using this approach we do not have to worry that every user is using the latest release or not. As, There are more then 100 clients per department.

但是问题是JNLP不是升级新的jar文件,以下是my.jnlp文件

But the problem is JNLP isn't upgrade the new jar file in the following is the my.jnlp file

<?xml version="1.0" encoding="utf-8"?> 
<jnlp spec="1.0+" codebase="http://192.168.1.26:8080/" href="Test.jnlp">
<information>
    <title>HC</title>
    <vendor>DRL</vendor>
    <homepage href="http://192.168.1.26:8080/" />
    <description>DRL</description>
    <offline-allowed/>
</information>
<security>
    <all-permissions/>
</security>
<resources>
    <j2se version="1.6+" />
    <jar href="JnlpTest.jar" download="eager" />
</resources>
<application-desc 
    name="HC-DRL"
    main-class="com.drl.simap.client.module.ui.Splash" />
</jnlp>

我的工作环境: Tomcat-6.0服务器和以下教程 此处

My working environment: Tomcat-6.0 server and following tutorial here

推荐答案

如果您下载了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.

这篇关于JNLP不会自动更新JAR文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆