Safari 中 Java Applet 出现格式错误的 URL 异常
我想知道这是只有我还是什么。我编写了一个小程序,可以在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来 WebKit 正在删除 http://
顺便说一句,它不在你的 init 函数中,它是 URL 的构造函数
Looks like WebKit is removing the http://
Btw, it is not in your init function, it is URL's constructor
显然,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.