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

'safe' properties ignored if not in first <resources> element of a JNLP file

    XMLWordPrintable

Details

    • b70
    • generic
    • generic

    Description

      In Web Start for J2SE 1.4 (I believe) a feature was added that defined a collection of 'safe' properties that should be set at VM launch time. However, this only happens if one of those 'safe' properties is defined in the first <resources> element in the JNLP file.

      This is particularly problematic on Mac OS X, since we tell developers that properties that are only relevant for Mac OS X should go into a resources element with the 'os="Mac OS X"' modifier, and common practice says that you should put the common properties and JAR files first in a platform-independent resources element, and then any OS/architecture/locale-specific elements after that.

      Example of JNLP code that fails to set brushed metal property:
      <resources>
        <! Platform independent resources -->
      <jar href="myapplication.jar"/>
      </resources>

      <resources os="Mac OS X">
        <property name="apple.awt.brushMetalLook" value="true"/>
      </resources>

      Section 4.2 of the JNLP spec says that "[p]roperties set in the JNLP file may be set by the JNLP Client at any time before the application's code is executed; thus, it cannot be assumed that they will be set during the initialization of the virtual machine." Given that escape clause, this is technically correct behavior, but I think it's worth clarifying the current behavior of the code either in the JNLP specification, or at least documenting this restriction.

      Attachments

        Activity

          People

            herrick Andy Herrick (Inactive)
            ksoshals Kirill Soshalskiy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: