There's a bug or two with the escaping. see
http://issues.apache.org/bugzilla/show_bug.cgi?id=28528
Eventually we'll dig into this.
Try following Nathan's suggestion, but bear in mind you might be hitting
this item or a variant.
WILL
----- Original Message -----
From: "Nathan Bubna" <[EMAIL PROTECTED]>
To: "Velocity Developers List" <[email protected]>; "Llewellyn
Falco" <[EMAIL PROTECTED]>
Sent: Monday, August 29, 2005 5:10 PM
Subject: Re: escaping velocity
i'm not sure why $object.get${methods}() is giving you a syntax error.
if there is no "getGet", "getget", or get("get") method for your
$object, then you should still get $object.getMethod() in your output
(though that will trigger an invalid reference message in your logs).
anyway, if you have done ctx.put("methods", "Method") and do the
following in your template...
#set( $D = '$' )
${D}object.get${methods}()
then you should get...
$object.getMethod()
after your first pass (with no invalid reference messages).
if you are still getting a syntax error, then perhaps parser is
(wrongly) bothered by the parentheses. in that case, try
#set( $D = '$' )
#set( $PS = '()' )
${D}object.get${methods}${PS}
On 8/29/05, Llewellyn Falco <[EMAIL PROTECTED]> wrote:
interesting escaping rule...
\$object.method()
could parse to
\$object.method()
$object.method()
depending on weather or not method is defined...
which brings an interesting question.
i want to generate a velocity template.
final result looks like
---
$object.getMethod()
---
i have context
put("methods", "Method")
i could write
\$object.get${methods}()
but since $object.get is undefined, this would parse to
\$object.getMethod()
which be what i want.
of course i could do
$object.get${methods}()
but that's a syntax error.
so any suggestion?
llewellyn.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]