Safari 中 Java Applet 出现格式错误的 URL 异常

发布于 2024-10-23 19:28:05 字数 831 浏览 1 评论 0原文

我想知道这是只有我还是什么。我编写了一个小程序,可以在 Chrome、Firefox 和 IE 中完美运行,但当我在 Safari 上尝试时,它在初始化时立即死掉。问题是,我的 init 函数实际上没有做任何事情,只是将“Initialized”打印到 java 控制台。

我在 java 控制台中收到以下信息(请注意我的“初始化”调试消息):

Initialized
java.net.MalformedURLException: no protocol: 
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at sun.plugin.liveconnect.SecureInvocation.checkLiveConnectCaller(Unknown Source)
    at sun.plugin.liveconnect.SecureInvocation.access$000(Unknown Source)
    at sun.plugin.liveconnect.SecureInvocation$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source)

我开始认为这是 Safari 问题,因为尝试启动小程序的行为使其失败。

I was wondering if this is just me or what. I've written an applet that works perfectly in Chrome, Firefox, and IE, but when I try it on Safari, it immediately dies on init. The thing is, my init function doesn't really do anything but print out "Initialized" to the java console.

I get the following in the java console (Note my "Initialized" debugging message):

Initialized
java.net.MalformedURLException: no protocol: 
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at sun.plugin.liveconnect.SecureInvocation.checkLiveConnectCaller(Unknown Source)
    at sun.plugin.liveconnect.SecureInvocation.access$000(Unknown Source)
    at sun.plugin.liveconnect.SecureInvocation$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source)

I'm starting to think it's a Safari problem since the act of trying to start an applet makes it fail.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谎言月老 2024-10-30 19:28:05

看起来 WebKit 正在删除 http://

顺便说一句,它不在你的 init 函数中,它是 URL 的构造函数

Looks like WebKit is removing the http://

Btw, it is not in your init function, it is URL's constructor

用心笑 2024-10-30 19:28:05

显然,Safari 不喜欢我在小程序中调用的方法被称为“print”,

我将其重命名为“printDocument”,现在它可以工作了。我仍然遇到格式错误的 url 异常,但它似乎根本不会阻止小程序工作。

Apparently, Safari doesn't like that the method I was calling in the applet was called "print"

I renamed it to "printDocument" and it works now. I still get that malformed url exception, but it doesn't seem to prevent the applet from working at all.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文