(Java)Java Web Startを使ってみたの補足資料です。
■JNLP呼び出し用HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Java Web Start Sample</title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
var javawsInstalled = 0;
var javaws142Installed=0;
var javaws150Installed=0;
var javaws160Installed = 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;
javaws160Installed = 1;
}
}
else {
isIE = "true";
}
</SCRIPT>
<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
If Not(IsObject(CreateObject("JavaWebStart.isInstalled.1.6.0.0"))) Then
javaws160Installed = 0
Else
javaws160Installed = 1
End If
End If
</SCRIPT>
<script language="JavaScript">
if (javaws160Installed || (navigator.userAgent.indexOf("Gecko") !=-1)) {
document.write("<a href=http://xxx.xxx.com/jws/hello.jnlp>Launch the application(Java Web Start テスト)</a>");
} else {
document.write("Click ");
document.write("<a href=http://java.sun.com/PluginBrowserCheck?pass=http://xxx.xxx.com/jws/download.html&fail=http://java.sun.com/javase/downloads/ea.jsp>here</a> ");
document.write("to download and install JRE 6.0 and the application.");
}
</SCRIPT>
</body>
</html>
■JRE未インストール時に呼び出される download.html
<HTML>
<BODY>
<OBJECT codebase="http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab#Version=6,0,0,0"
classid="clsid:5852F5ED-8BF4-11D4-A245-0080C6F74284" height=0 width=0>
<PARAM name="app" value="http://xxx.xxx.com/jws/hello.jnlp">
<PARAM name="back" value="true">
<!-- Alternate HTML for browsers which cannot instantiate the object -->
<A href="http://java.sun.com/javase/downloads/ea.jsp">
Download Java Web Start</A>
</OBJECT>
</BODY>
</HTML>