On Aug 29, 2009, at 6:33 AM, rzo wrote:

Hello,

thanks for mentioning jexl scripting.
I tried it out and have found the following issue:

evaluating the following:

test=${expr:if (System.getProperty("user.home").startsWith("C")) {"x";} else {"z";}}

does not seem to work.
Debuging shows that the expression forwarded to jexl is:

if (System.getProperty("user.home").startsWith("C")) {"x";

is this a bug ? or is there a way to escape the brackets within $ {...} ?


The "bug" is actually the way org.apache.commons.lang.text.StrSubstitutor works. It can configured be with prefix and suffix characters - the defaults are '{' and '}' and after finding the prefix it just searches for the first occurance of the suffix character - unless it finds a recursive variable. So the string passed to ConfigurationInterpolator is what you show above.

However, it might be possible to override the suffix matcher to look for an escape character.

Ralph


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to