You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Arkadiusz Ryćkowski <ar...@aster.pl> on 2005/11/23 11:18:34 UTC

how to get such output

I need to get as final output the following string
bla bla ${xxx.yyy(&quot;value1&quot;)} bla bla

where value1 is the value of $value1 variable. I'm new to velocity and  
cannot manage with escape characters


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


Re: how to get such output

Posted by Mike Kienenberger <mk...@gmail.com>.
The most predictable and reliable way to do escaping is to assign the
character to a variable or tool method.

If you're using the escape tool, you'd just use

bla bla ${esc.d}{xxx.yyy(&quot;${value1}&quot;)} bla bla

Otherwise, you can use

#set ( $d = '$' )
bla bla ${d}{xxx.yyy(&quot;${value1}&quot;)} bla bla

I don't think you need to escape &, but I always escape # and $ when
writing velocity templates that create other velocity templates.

On 11/23/05, Arkadiusz Ryćkowski <ar...@aster.pl> wrote:
> I need to get as final output the following string
> bla bla ${xxx.yyy(&quot;value1&quot;)} bla bla
>
> where value1 is the value of $value1 variable. I'm new to velocity and
> cannot manage with escape characters
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>