Hi folks,

I'm using Velocity to generate Java classes, servlets and other templates,
based upon a given database schema. Up to now, everything was tickety-boo,
but I'm having some problems writing templates that get parsed to produce
other templates.

The first problem was how to escape a comment directive ('##') in my source
template, so that it would be written out correctly to my destination
template. At the moment, the undernoted code works, but is there another way
?

#set ($hash = "#")
$hash$hash
$hash$hash This is a comment to appear in the output
$hash$hash

Secondly, an escaping problem that I've not yet found a workaround for. My
destination template should contain a reference '$!BreederSurname'. My
source template includes a reference '$column.getName()', which in this
instance returns the value "BreederSurname". How do I combine the two ?

I've trawled the documentation, and the archives, but the closest I could
find was a message from Geir in December last year, ("more escaping fun"),
which touched on the issue, but didn't solve it for me.

   Cheers,

       Stu.

   Lead Developer  -  Computer Applications Ltd


Reply via email to