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

查看:109
本文介绍了在下载和执行文件时替换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正在使用此NPAPI东西用Java创建战争.因此,我必须在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
  • Install4

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的价格价格,可能会有免费软件/开源替代品. SO4经常在此处讨论Install4J及其替代方案,您可能需要在此处进行检查.

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