Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/357.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何强制firefox使用JavaWebStart打开页面?_Java_Mime Types_Content Type_Jnlp - Fatal编程技术网

如何强制firefox使用JavaWebStart打开页面?

如何强制firefox使用JavaWebStart打开页面?,java,mime-types,content-type,jnlp,Java,Mime Types,Content Type,Jnlp,我有一个存储盒管理页面,应该用JavaWebStart打开。然而,在我的MacBook上的所有浏览器上,这并没有发生,相反,我只得到了一个html页面,其中保存了内容:“v6.3.1a Web Tools 10.1.18.222” 查看页面的javascript代码,我看到它正在尝试检测是否安装了正确的Java Web Start: function webstartVersionCheck(versionString) { // Mozilla may not recogniz

我有一个存储盒管理页面,应该用JavaWebStart打开。然而,在我的MacBook上的所有浏览器上,这并没有发生,相反,我只得到了一个html页面,其中保存了内容:“v6.3.1a Web Tools 10.1.18.222”

查看页面的javascript代码,我看到它正在尝试检测是否安装了正确的Java Web Start:

function webstartVersionCheck(versionString) {
        // Mozilla may not recognize new plugins without this refresh
    navigator.plugins.refresh(true);
    // First, determine if Web Start is available
    if **(navigator.mimeTypes['application/x-java-jnlp-file'])** {
        // Next, check for appropriate version family
        for (var i = 0; i < navigator.mimeTypes.length; ++i) {
                pluginType = navigator.mimeTypes[i].type;
            if (pluginType == "application/x-java-applet;version=" + versionString) {
                return true;
            }
        }
    }
    return false;
}
函数webstartVersionCheck(versionString){
//没有此刷新,Mozilla可能无法识别新插件
navigator.plugins.refresh(true);
//首先,确定Web Start是否可用
if**(navigator.mimeTypes['application/x-java-jnlp-file'])**{
//接下来,检查适当的版本族
对于(变量i=0;i
这里称之为:

function writeMozillaData(page) {
        versionCheck = webstartVersionCheck("1.5");
    if (!versionCheck) {
        var pluginPage = "http://jdl.sun.com/webapps/getjava/BrowserRedirect?locale=en&host=java.com";
        document.write("The version of Java plugin needed to run the application is not installed. The page from where the plugin can be downloaded will be opened in a new window. If not, please click here: <a href=" + pluginPage + ">Download correct Java version.</a>");
        window.open(pluginPage, "needdownload");
    } else {
        window.location = page;
    }
}
函数writeMozillaData(第页){
versionCheck=webstartVersionCheck(“1.5”);
如果(!versionCheck){
var pluginPage=”http://jdl.sun.com/webapps/getjava/BrowserRedirect?locale=en&host=java.com";
document.write(“未安装运行应用程序所需的Java插件版本。可下载插件的页面将在新窗口中打开。如果未安装,请单击此处:”;
打开(pluginPage,“needdownload”);
}否则{
window.location=页面;
}
}
我在mimeTypes中添加了一个警报,注意到navigator中没有显示“application/x-java-jnlp-file”的mimeType

问题:

  • 这是导致浏览器将内容解释为文本/html并保存html的原因吗
  • 我如何在这里强制启动JavaWebStart
  • 我确实有firefox设置指示jnlp由JavaWebStart应用程序处理,因此我怀疑浏览器根本没有将页面解释为jnlp

    …导航器中没有显示的
    应用程序/x-java-jnlp-file
    的mimeType

    这是导致浏览器将内容解释为文本/html并保存html的原因吗

    几乎可以肯定是的。修复内容类型