velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apa...@recks.org
Subject Re: simple question
Date Wed, 11 Oct 2006 11:35:02 GMT
your string matches Velocity semantics up to the "(",
and that is why the parser has trouble witch what comes
afterwards.

Just replace the initial "$" to soothe the barking parser:
#set( $D = '$' )
...
${D}{loginGenerator.generateLogin("John","Smith")}
...

This $D form is what has been called the "failsafe
escaping" or "poor man's escaping" (TM) and will always
work within Velocity.

I even believe you probably don't even need to escape
the html expressions (but this surely depends on your
application):
${D}{loginGenerator.generateLogin("John","Smith")}

Cheers,
Christoph

Arkadiusz Ryćkowski wrote:
> I've to generate the string like
> ${loginGenerator.generateLogin("John","Smith")}
> 
> I've tried to use template like
> ${loginGenerator.generateLogin("$user.firstName","$user.lastName")}
> and with escape \${loginGenerator...
> 
> but still I cannot manage with error: Encountered "( "" at line
> 12, column 72
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message