Applet 可以在 IE 中运行,但不能在 Firefox 中运行
所以我创建了一个小程序,它在本地硬盘上创建一个文件,并最终将其上传到我创建的 CGI。
当在 IE 上运行时,该小程序工作正常,并正确创建和上传文件。 但是,在 Firefox 上,我在 Java 控制台上收到错误“访问被拒绝”,表明它根本无法创建该文件。我自己创建了证书,没有购买证书或通过公司进行验证。
我需要一个适用于任何可能使用该小程序的人的解决方案,这意味着修复不能只是编辑我自己的设置,除非我可以对每台接受证书的计算机执行此操作。
So I have created an applet that creates a file on the local hard drive, and eventually uploads it to a CGI that I have created.
When run on IE, the applet works fine, and creates and uploads the file properly.
However, on firefox, I get an error on the Java Console, access denied, showing me that it simply can't create the file. I created the certificate myself, and did not buy one or have it verified through a company.
I need a solution that will work for anybody who potentially uses the applet, meaning the fix can't just be editing my own settings, unless I can do that with every computer that accepts the certificate.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
未签名的小程序无法在所有浏览器上访问本地磁盘。它在 IE 中对你有用,因为我相信你是从文件系统(而不是通过 http)运行它的。因此,正确的解决方案是不要在磁盘上创建文件。在内存中创建内容并上传。但请记住:您只能连接到下载小程序的服务器。
如果您确实必须创建本地文件,则必须对该小程序进行签名。
Unsigned applets cannot access local disk on all browsers. It worked for you in IE because I believe that you ran it from file system (not via http). So, the right solution is not to create file on disk. Create content in memory and upload it. But remember: you can connect only to server the applet was downloaded from.
If you really have to create local file you have to sign the applet.
可能需要进行一些
设置
。原因之一可能是您的 Mozilla Firefox 未启用 java。检查以下链接:
要测试 Web 浏览器中是否启用了 java,请单击 [此处]
May be, some
setting
has to be done. One of the reason could be your Mozilla Firefox is not java enabled.Check the following links :
To test whether java is enabled or not in a web browser, click [here]
此错误可能相关。
它指出 Firefox 会杀死加载时间过长的 Java 小程序。我有一个示例,从本地资源加载时工作正常,但在远程时失败。有时,重新打开小程序可以使其正常工作,因为它似乎每次都会加载越来越多的类。
This bug may be relevant.
It states that Firefox kills java applets that take too long to load. I have an example that works fine when loaded from a local resource but fails when it is remote. Sometimes, reopening the applet can make it work as it appears that it loads more and more of the classes each time.