You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by phillip rhodes <rh...@telerama.com> on 2002/10/09 04:05:56 UTC
escaping problem help sought.
I am trying to output some valid velocity code that a user can cut and paste into a velocity template. However, there is a mixture of both vtl and variables, some of which I want to be interpolated, and some not. I got things to work by splitting the line I want to output into 2 lines. But if I try everything on the same line, my variable interpolations do not happen.
While I can hobble along, I feel bothered by not understanding what I am doing wrong. According to the docs on escaping, what I am doing on one line should work. Can anything point out a limitation of velocity or how I can achieve this in velocity?
This is what I want to output... (I do have this output if I break it up using two lines.
#jcontrol($jpage.getQuestionByName( "Which colorectal test used").getQuestionItemByName("Colonoscopy")
$questionname and $questionItem are two in scope variables that I want interpolated.
#jcontrol is a macro that I do not want to invoke, but needs to be output.
This is working: (it's on two lines)
\#jcontrol($jpage.getQuestionByName(
"${questionname}").getQuestionItemByName("${questionItem.getName()}")
This is not working:
\#jcontrol($jpage.getQuestionByName("${questionname}").getQuestionItemByName("${questionItem.getName()}")
Thanks!!