Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4414214

JaWS doesn't process properties in the order specified in the JNLP file.

XMLWordPrintable

    • 1.0.1
    • sparc
    • solaris_2.6
    • Verified



      Name: aaR10142 Date: 02/12/2001



      The jnlp spec says:
      "
      Properties must be processed in the order specified in the JNLP file. Thus, if two properties define different values for the same property, then the last value specified in the JNLP file is used. For example, given the following two declarations, n the given order:

      <property name="key" value="overwritten"/>
      <property name="key" value="used"/>

      Then the property key will have the value used.
      "

      But the javaws does not follow this doc and uses "overwritten" value.
      See example

      ------------- test.jnlp ----------
      <?xml version="1.0" encoding="UTF-8"?>
      <jnlp spec="0.2+" version="1.0"
        codebase="http://falcon:12345">
        <information>
          <title>Test</title>
          <vendor>Sun Microsystems, Inc.</vendor>
          <homepage href="index.html"/>
          <description>Test</description>
        </information>
        <resources>
          <j2se version="1.3 1.2"/>
          <jar href="main.jar"/>
          <property name="key" value="overwritten"/>
          <property name="key" value="used"/>
        </resources>
        <application-desc main-class="Main">
        </application-desc>

      </jnlp>

      --------------Test.java----------------
      import java.awt.Frame;
      import java.awt.Label;

      public class Main {
          public static void main(String[] args) {

               String propValue = System.getProperty("key");


               Frame f = new Frame("Test");
               f.add(new Label("Property value: " + propValue));
               f.setSize(300, 100);
               f.setVisible(true);
                        
          }
      }

      ------------------- OUTPUT ------------
      Property value: overwritten


      ======================================================================

            herrick Andy Herrick (Inactive)
            alisunw Ali Ali (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: