在下载和执行文件时替换 Applet [英] Replace Applet in downloading and executing a file

查看:21
本文介绍了在下载和执行文件时替换 Applet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,它有一个小程序,可以做两件简单的事情:

I have an application that has an applet that does two simple things:

  • 从我们的服务器(如果用户还没有)下载一个可执行的 jar 文件到用户 PC 中的特定文件夹
  • 执行带有对应参数的jar文件

此 jar 文件监视 Office 文件的更改并将其发送回我们的服务器.

This jar file monitors an Office file for changes and send it back to our server.

问题是 Chrome 正在用 Java 与这个 NPAPI 东西创建战争.所以我必须在 9 月之前考虑替代技术或停止支持 Chrome.

The problem is the war Chrome is creating with Java with this NPAPI thing. So I have until September to think of an alternate technology or stop the Chrome support.

您是否想到了其他方法来实现相同的结果?只需下载并执行.看起来并不难 =(.HTML 5 能做到吗?

Do you think of some other way to achieve the same result? Just download and execute. Doesn't seem that hard =(. Can HTML 5 do that?

编辑

我正在研究 Java Web Start 并变得有点高兴.看来它可以做我想做的事:执行最新的 jar 文件传递​​参数.但我从未与 JWS 合作过,所以我有一些疑问:

I was looking into Java Web Start and became a little happy. It appears that it can do what I want: executing a up to date jar file passing parameters. But I never worked with JWS, so I have some doubts:

  • 是否可以给它传递参数?我读过一些您可以配置来执行此操作的 JSP 文件,但我仍然不确定.

  • Is it possible to pass parameters to it? I read about some JSP files that you can configure to do that, but I'm still unsure.

理论上,它应该从浏览器链接自动启动,对吗?我试过这个网站:https://docs.oracle.com/javase/tutorial/deployment/webstart/running.html

Theoretically, it should start automatically from a browser link, am I right? I tried this site: https://docs.oracle.com/javase/tutorial/deployment/webstart/running.html

它并没有那样工作.我必须在 Google Chrome 上标记始终打开该类型的文件".有没有办法让它自动化?

and it didn't work that way. I had to mark "always open files of that type" on Google Chrome. Is there a way for automatize it?

再次感谢!!

推荐答案

据我所知,至少有两件事可以让您坚持使用 Java.

From what I know there are at least two things that allow you to stick with Java.

Webstart 由 Oracle 提供,允许您从 Web 下载 Java 程序并执行它们.存在更新机制,因此您始终可以提供当前版本.

Webstart is provided by Oracle and allows you to download Java program from the web and execute them. Update mechanisms exist, so you can always provide a current version.

Install4J(或任何其他提供更新机制的 Java 应用程序安装程序)提供了一个安装程序,使您的客户能够安装应用程序,该应用程序随后将通过集成更新机制保持最新.但是 Install4J 的价格是价格,可能有免费软件/开源替代品.Install4J 及其替代方案经常在此处讨论 SO,您可能需要在此处查看.

Install4J (or any other installer for Java applications that offers an update mechanism) provides an installer which enables your customer to install an application which afterwards will be kept up to date by the integrated update mechanism. But Install4J comes at a price, there might be freeware / open source alternatives. Install4J and its alternatives are often discussed here on SO, you might want to check here.

我认为 HTML5 的 FileAPI 是有限的,不能访问任意文件,因为沙箱可以防止这种情况.您可以再次检查 SO 以了解 有关详细信息.

I think the FileAPI of HTML5 is limited and can not access arbitrary files because a sandbox prevents this. You might check SO again for details about that.

这篇关于在下载和执行文件时替换 Applet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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