使用Web Start / JNLP动态加载其他jar文件 [英] Dynamically load additional jar files using Web Start / JNLP

查看:271
本文介绍了使用Web Start / JNLP动态加载其他jar文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Web Start Developers Guide states


必须从JNLP文件的resources部分中指定的
的JAR文件中检索所有应用程序资源,或者使用对Web服务器的HTTP请求显式检索

All application resources must be retrieved from the JAR files specified in the resources section of the JNLP file, or retrieved explicitly using an HTTP request to the Web server.

建议在JAR文件中存储资源,因为它们将由Java Web Start在本地计算机上缓存

Storing resources in JAR files is recommended, since they will be cached on the local machine by Java Web Start.

现在,我想在应用程序启动后动态加载一些资源(例如OSGi包)。我可以使用普通的HTTP做到这一点,但我想利用Web Start对本地缓存和版本化/架构特定资源的支持。

Now, I have some resources I want to dynamically load after my application has been started (for example OSGi bundles). I can do this using plain HTTP, but I would like to make use of Web Start's support for local caching and versioned/architecture-specific resources.

有没有办法使用Web Start基础架构从原始代码库(在应用程序的jnlp文件中指定)下载其他jar文件?

Is there a way to download additional jar files from the original code base (as specified in the application's jnlp file) using the Web Start infrastructure?

或者:已经有一种既定的集成方式OSGi和Web Start可以减轻我从Web Start服务器安装捆绑包的任务吗?

Or alternatively: is there already an established way to integrate OSGi and Web Start that would relieve me of the task to install bundles from the Web Start server?

推荐答案

如果您提出申请本身就是一个基于Equinox的OSGI应用程序,您可以使用所需的所有附加软件包进行Web启动。

If you make your application in itself an Equinox-based OSGI application, you can web-start it with all the addition bundles you need.

本文 WebStarting Equinox OSGi应用程序可以为您提供所需设置的良好介绍。

This article "WebStarting Equinox OSGi Apps" can give you a good introduction on the required settings.



  • 所有捆绑包都必须是部署为已签名的JAR文件

  • 您需要一个包含所有必需包的功能

  • 导出功能时,请确保PDE创建JNLP(用于此功能的Java Network Lauching Protocol)文件(导出向导中的复选框)

  • 为您的应用程序提供根JNLP文件

  • 部署应用程序到Web服务器并确保Web服务器知道application / x-java-jnlp-file mime类型

  • All bundles have to be deployed as signed JAR files
  • You need a feature that contains all the necessary bundles
  • When exporting the feature, make sure that PDE creates a JNLP (Java Network Lauching Protocol) file (a checkbox in the export wizard) for this feature
  • Provide a root JNLP file for you application
  • Deploy your application to a web server and make sure that the web server is aware of the application/x-java-jnlp-file mime type

他还有 OSGI演示

这篇关于使用Web Start / JNLP动态加载其他jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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