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

查看:31
本文介绍了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 spec 并查看第 6 章,有一整节是关于缓存的:6 资源的下载和缓存"

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 Client 不能假设 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.

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

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天全站免登陆