简体   繁体   English

将Java Web Start jar与Web应用程序集成

[英]Integrating Java Web Start jar with web app

I have a web application, which does file transfer via applet. 我有一个Web应用程序,它通过applet进行文件传输。

For more security reasons, I am planning to do encryption on the files being sent from my app. 为了安全起见,我打算对从我的应用发送的文件进行加密。 For that purpose, I wish to integrate java web start program, I will have the RSA encryption logic written as a part of the web start jar. 为此,我希望集成Java Web Start程序,并将RSA加密逻辑编写为Web Start jar的一部分。

I have created a separate web start project (WAR), and am able to launch the jar & perform the required encryption. 我创建了一个单独的Web启动项目(WAR),并且能够启动jar和执行所需的加密。

My components for web start project are: 我的Web启动项目组件为:

  1. main class - Encryption.java (Logic for encryption) 主类-Encryption.java(加密逻辑)
  2. Deployment Descriptor - web.xml 部署描述符-web.xml
  3. Servlet - where am setting the response content type as application/x-java-jnlp-file Servlet-将响应内容类型设置为application/x-java-jnlp-file
  4. JNLP file(Rendered as jsp) JNLP文件(呈现为jsp)

I have a signed jar created with the main class file, and it works when i add it as a part of my independent WAR. 我有一个用主类文件创建的签名jar,当我将其添加为独立WAR的一部分时,它可以工作。

But when I merge with my web app. 但是,当我与Web应用程序合并时。 (I added the web start jar as a part of my ear lib folder), am unable to launch it, & that shows "Unable to load resource: " (我将Web Start jar添加为我的Ear lib文件夹的一部分),无法启动它,并显示“无法加载资源:”

Exception got: com.sun.deploy.net.FailedDownloadException: Unable to load resource: 
  Wrapped exception : java.util.zip.ZipException: ZIP file must have at least one entry

Is there any format I need to follow to make this jar reference work? 我需要遵循什么格式才能使此jar参考有效?

Am much new to Web start, so looking forward for your inputs on this issue. Web入门很新,因此期待您对此问题的投入。

(I added the web start jar as a part of my ear lib folder),.. (我将网络启动jar添加到我的ear lib文件夹中),..

I am not sure, but that sounds like a path for a web app. 我不确定,但这听起来像是Web应用程序的路径。 to put its own APIs. 放置自己的API。 If such it will not be a path accessible through an URL in the browser, nor to a JWS client that is trying to open it. 如果这样,它将既不是通过浏览器中的URL访问的路径,也不是试图打开它的JWS客户端的路径。

For each jar in your desktop app.: 对于桌面应用程序中的每个jar。

  1. Put them in a place that is accessible to a browser. 将它们放在浏览器可访问的位置。 EG I use pscode.org/lib/ . 例如,我使用pscode.org/lib/
  2. Then check the resource path using either of: 然后使用以下任一方法检查资源路径:
    1. By putting the resolved URL of the Jar in the address bar of the browser and attempting to fetch it. 通过将Jar的解析URL放在浏览器的地址栏中,然后尝试获取它。
    2. Use JaNeLA which does that & more in a single check. 使用JaNeLA ,一次检查即可完成更多操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM