4 Replies Latest reply: Sep 22, 2012 3:17 AM by 817264 RSS

    arguments from JNLP not passed to application

    stephen_byrne
      Arguments in a JNLP are not passed to the application when started with the "launchWebStartApplication" function in deployJava.js. If the "createWebStartLaunchButton" mechanism is used or javaws is called directly with the URL to the JNLP the arguments are passed.

      It works in 1.7.0_05, but is broken in 1.7.0_06 and 1.7.0_07. (x86 on Windows XP SP2, Windows Server 2008 R2)
      It works in 1.7.0_05, 1.7.0_06, and 1.7.0_07. (x64, Windows Server 2008 R2)

      Is there a documented security reason for this, or am I doing something wrong that happened to work before, or is this a bug?

      My JNLP is:
      <?xml version="1.0" encoding="UTF-8"?>
      <jnlp
        spec="7.0+"
        codebase="http://localhost/~stephen/djbug"
        href="djbug.jnlp">
      
        <information>
          <title>Test DeployJava bug</title>
          <vendor>test</vendor>
          <homepage href="http://www.example.com/"/>
          <description>Test DeployJava bug</description>
          <description kind="short">djbug</description>
        </information>
      
        <resources>
          <jar href="build/libs/djbug.jar" main="true" />
        </resources>
      
        <application-desc main-class="test.PrintArgs">
          <argument>Hello</argument>
          <argument>world!</argument>
          <argument>(it worked)</argument>
        </application-desc>
      
      </jnlp>
      My use of deployJava is:
      <html>
        <body>
          <script src="http://java.com/js/deployJava.js"></script>
          <script>
            var url = 'djbug.jnlp';
          </script>
      
          Clicking this button works:
          <script>
            deployJava.createWebStartLaunchButton(url,'1.7.0');
          </script>
      
          <hr>
      
          Clicking this button does not work:
          <script>
            function launchBroken() {
              deployJava.launchWebStartApplication(url);
            }
          </script>
          <form style="display:inline">
            <input value="click me" type="submit" onClick="javascript:launchBroken();return false;"></input>
          </form>
      
          <hr>
      
          <a href="djbug.jnlp">Clicking this link works.</a>
      
        </body>
      </html>