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

Impossible to specify percent sign in JNLP applet param value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 7u67, 8u20
    • deploy
    • x86_64
    • windows

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      It looks like it is impossible to specify an applet parameter whose value contains a percent (%) sign.

      I am using new-generation, JNLP-based applet deployment, and in my applet JNLP file I am trying to use a parameter looking like this:

      [...]
      <applet-desc
           name="My Applet Name"
           main-class="com.company.TestClass"
           width = "800"
         height = "600">

      <param name="sampleParamName" value="Sample param value with % sign"/>
      [...]

      The, if in my JApplet I call "getParameter("sampleParamName")", I obtain a completely empty string.

      I have also tried using the encoded entity syntax, looking like this:

      [...]
      <param name="sampleParamName" value="Sample param value with &#37; sign"/>
      [...]

      but I obtain exactly the same behavior: I get an empty value as a return value for the getParameter("sampleParamName") call.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Just develop a sample JApplet, and deploy it through the new-generation (i.e., JNLP-based) applet deployment model.

      Inside the JNLP source code, pass an applet parameter containing a percent sign, like this:

      [...]
      <param name="sampleParamName" value="Sample param value with % sign"/>
      [...]

      or also like this:

      [...]
      <param name="sampleParamName" value="Sample param value with &#37; sign"/>
      [...]

      Inside your JApplet Java source code, do the following call:

      String paramValue = getParameter("sampleParamName");

      paramValue will erroneously contain an empty string.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      getParameter("sampleParamName") should return the value specified inside the JNLP source, including the percent sign.
      ACTUAL -
      getParameter("sampleParamName") returns an empty string.

      REPRODUCIBILITY :
      This bug can be reproduced always.

            alitvinov Anton Litvinov (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: