The JWS Portal Page

The portal page (shown in Figure B-9) contains a mix of JavaScript and VBScript, which attempts to detect if JWS is present on the client machine. If it isn't, then the user will be given the option of downloading a JRE. The task is considerably complicated by the many variations between browsers, operating systems, and platforms. Example B-4 is a simplified version of the page.

Example B-4. Simple version of JNLP portal page

    <HTML>
    <HEAD><TITLE>Java Web Start Portal</TITLE>
    <script language="JavaScript" type="text/javascript">
   
      // check in various ways if JWS is installed;
      // decide if the browser is IE on Windows
   
      function insertLink(url, name) {...}
      // add a link to the named URL if JWS is present
   
      function installInfo() {...}
      // report whether JWS has been found
   
      function nativeReport() {...}
      // warn about the use of Windows DLLs by BugRunner and Checkers3D</script>
   
    <script language="VBScript">
      // check for various JWS objects in the Windows registry
    </script>
   
    </HEAD>
    <BODY><H1>Java Web Start Portal</H1>
   
    <script language="JavaScript" type="text/javascript">
      installInfo();
      nativeReport();
    </script>
   
    <h2>Installation Links</h2>
    <P><ul>
      <li><script language="JavaScript" type="text/javascript">
        insertLink("time.jnlp", "Official US Time");
      </script>
   
      <li><script language="JavaScript" type="text/javascript">
        insertLink("BugRunner/BugRunner.jnlp", "BugRunner");
      </script>
   
      <li><script language="JavaScript" type="text/javascript">
        insertLink("Checkers3D/Checkers3D.jnlp", ...

Get Killer Game Programming in Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.