velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plynch...@netscape.net
Subject RE: escaping problem help sought.
Date Wed, 09 Oct 2002 21:03:36 GMT
Try this:
\#jcontrol($jpage.getQuestionByName(##
"${questionname}").getQuestionItemByName("${questionItem.getName()}")

Still on two lines, but the ## at the end of the first should get
rid of the newline in the output.
  --Paul

"phillip rhodes" <rhodespc@telerama.com> wrote:

>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!!
>
>
>


-- 
Paul Lynch
Aquilent, Inc.
National Library of Medicine


__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp


Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

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


Mime
View raw message