Web Start 中 jar 的版本属性

发布于 2024-09-25 23:36:12 字数 67 浏览 6 评论 0原文

在 JNLP 文件中,jar 资源的版本属性是否与任何元数据(例如清单)相关,还是由创建 JNLP 文件的用户任意设置?

In a JNLP file, is the version property for a jar resource related to any metadata (e.g. manifest) or is it just arbitrarily set by the user creating the JNLP file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

反目相谮 2024-10-02 23:36:12

JNLP 规范第 6 节在第 6.3 节“基于版本的下载协议”下提供了以下信息。


For the version-based download protocol, all resources are uniquely identified by a URL/version-id pair. Thus, a JNLP Client can at any given time request a specific version of a resource located at a specific URL.

JNLP 客户端发出 HTTP GET 请求,其中包含所需资源的特定版本。该请求包含字段version-id,该字段指定请求的版本。例如,给定以下 jar 元素:

<jar href="http://www.mysite.com/b.jar" version="2.3+"/>

那么 JNLP 客户端必须发出以下 HTTP GET 请求14:

http://www.mysite.com/c.jar?version-id=2.3%2B

JNLP 客户端必须检查 HTTP 响应状态代码和 MIME 类型以确定结果是否成功。有效响应在第 6.1.2 节中描述。对于上述 jar 元素,无法返回 application/x-java-archive-diff MIME 类型。它只能针对增量请求返回。

请求中使用的版本字符串不一定准确,例如2.3+。 Web 服务器必须通过设置 HTTP 标头字段 x-java-jnlp-version-id 来指定响应中返回的资源的确切版本 ID。返回的确切版本必须与请求的版本字符串匹配。


Unfortunately the Spec. is not available for online browsing, but it can be downloaded. I have found it to be invaluable for JWS development.

Section 6 of the JNLP Specification gives the following information under section 6.3 "Version-based Download Protocol".


For the version-based download protocol, all resources are uniquely identified by a URL/version-id pair. Thus, a JNLP Client can at any given time request a specific version of a resource located at a specific URL.

The JNLP Client issues an HTTP GET request that includes the specific version of the resource that it needs. The request includes the field version-id, which specifies the requested version. For example, given the following jar element:

<jar href="http://www.mysite.com/b.jar" version="2.3+"/>

then the JNLP Client must issue the following HTTP GET request14:

http://www.mysite.com/c.jar?version-id=2.3%2B

The JNLP Client must examine the HTTP response status code and MIME type to determine if the result was successful. The valid responses are described in section 6.1.2. For the above jar element, the application/x-java-archive-diff MIME type cannot be returned. It can only be returned for incremental requests.

The version string used in the request is not necessarily exact, e.g., 2.3+. The Web server must specify the exact version-id of the resource that is returned in the response by setting the HTTP header field: x-java-jnlp-version-id. The exact version returned must be one that matches the requested version string.


Unfortunately the Spec. is not available for online browsing, but it can be downloaded. I have found it to be invaluable for JWS development.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文