JDK-6650343 : Unable to read properties value with spaces specified against java_arguments
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6u10
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2008-01-15
  • Updated: 2010-04-04
  • Resolved: 2008-03-13
Related Reports
Duplicate :  
Description
Applet fails to read value against Properties, with name=value pair, defined inside the htmls using "java_arguments" if specified values contains spaces in it. Putting properties value with spaces inside the "" with escape character "\" returns "\" only when read inside the applet
Try to load the following applet.
http://sqeweb.sfbay/deployment2/jitu/deployment_mustang_exec_ws/deployment/src/plugin/runtimeArgs/runtimeArgs/html/secure/TestUntrustedSecureMOE.html
If read value is "/" instead of "User defined Trusted Test1" then bug is reproduced
We need to define our own escaping rules for JVM command-line parameters containing spaces. Experimentation has shown that we can not include a double quote ('"') inside the java_arguments parameter, even if it is escaped, because the browser treats this as the end of the parameter's value. We need to watch for the escaping character ('\') and always include the next character as part of the previous token. This implies replacing the StringTokenizer in JVMParameters.parseImpl() with our own custom character-by-character tokenizer.

Comments
EVALUATION Updated status to indicate this is a duplicate of 6668033, in which this fix was made.
13-03-2008

EVALUATION Sven's StringQuoteUtil class fixed most parsing issues of java_arguments. Close this bug as not reproducible in the latest 6u10 build.
13-03-2008

EVALUATION We need better document how to set attribute strings. Since the strings passed from browsers, they follow HTML specification. It sometimes can be confused with Java and javascript conventions.
13-02-2008

EVALUATION Is there java plugin specification regarding the format of param value strings? From experimentation, it seems impossible to support '\"', browser use " as the end of the quoted string. To use quote and white spaces in value string, the followings are supported right now: 1. based on HTML specification, single quote marks can be included within the attribute value when the value is delimited by double quote marks, and vice versa. <param name=java_arguments value='-Djpi.iconfile="c:/my docs/Big Duke.gif"'> is supported in current build. 2. white space is supported in a single pair of double quotes. for example, -Djpi.user.name="Duke Jr." is valid. 3. User HTML character reference. For example: vaule="-Djpi.user.name=&quot;Duke&x20;Jr.&quot;" Please note that plugin check each parsed token for unsupported characters. Tokens with unsupported chars will be rejected. The followings are not supported for now: Nested double quotes (substrings) is not supported. Double quote embeded in a string is not supported. And escaping is not supported. for example, "\n" is not parsed to new line. The current implementation can meet basic requirement. However, if there is a specification, or there are large amount existing tests that need more sophisticated parser, we can implement it.
12-02-2008