Does jnlp opening depend on context somehow?

Dear Experts,
I have a script to open launch an application via web start.
It works fine, when it is in its own html file. The jnlp file is interpreted.
If I copy and paste the code to where I really need it,
the jnlp file does't get interpreted any more. It is simply displayed as XML.
I don't see how this code should be dependent on the environment.
So I simply gave a link to the working html file and was ready to accept the detour.
However, the same problem occured.

I am completely lost on this issue.
Any ideas?
<SCRIPT LANGUAGE="JavaScript"> var javawsInstalled = 0;  
	var javaws142Installed=0;
	var javaws150Installed=0;	
	isIE = "false"; 
	if (navigator.mimeTypes && navigator.mimeTypes.length) {    
	 	x = navigator.mimeTypes['application/x-java-jnlp-file'];    
		if (x) { 
      		javawsInstalled = 1;       
			javaws142Installed=1;
      		javaws150Installed=1;   
		} 
	} else {    
	 	isIE = "true"; 
	} 
</SCRIPT> 
<!-- check IE, using vbscript NOT javascript -->
<SCRIPT LANGUAGE="VBScript">
	on error resume next
	If isIE = "true" Then
	  If Not(IsObject(CreateObject("JavaWebStart.isInstalled"))) Then
	     javawsInstalled = 0
	  Else
	     javawsInstalled = 1
	  End If
	  If Not(IsObject(CreateObject("JavaWebStart.isInstalled.1.4.2.0"))) Then
	     javaws142Installed = 0
	  Else
	     javaws142Installed = 1
	  End If 
	  If Not(IsObject(CreateObject("JavaWebStart.isInstalled.1.5.0.0"))) Then
	     javaws150Installed = 0
	  Else
	     javaws150Installed = 1
	  End If  
	End If
</SCRIPT>
 
<script language="javascript" type="text/javascript">
<!--
 	if (javawsInstalled ) { 
 	 	document.writeln("<form action=\"uploader/launch.jnlp\"><input type=\"submit\" value=\"Launch Uploader\" align=\"right\"></form><br>");
 	 	document.writeln("<a href='uploader/launch.jnlp'>Launch app</a>");
	} else { 
	 	document.writeln("Please install web start support in order to use the file uploader.<br>");
	 	document.writeln("<a href='http://java.sun.com/products/javawebstart/needdownload.html' target='_new'>Install Java Web Start support</a>.<br>");
	} 
// -->
</SCRIPT>

Open in new window

LVL 5
allmerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Ajay-SinghConnect With a Mentor Commented:
> If I copy and paste the code to where I really need it,
the jnlp file does't get interpreted any more. It is simply displayed as
XML.

 
How are you doing it? It sounds to me that you are copying .jnlp file
locally where .jnlp file extension is not registered to use java web start.
0
 
allmerAuthor Commented:
I am just copying the above code.
The jnlp file is always written on the fly (codebase needs full path).

The problem seems to be that my local apache installation does not support web start.
I could of course easily add that support.
This is however not possible for anyone using my package.
Therefore please let me rephrase my question.

How can I test whether the server is able to handle java web start or not programmaticaly.
Using either PHP, Java, or Javascript?

Thanks
0
All Courses

From novice to tech pro — start learning today.