Note that #literal() works well, but only so long as its contents are
valid, parse-able VTL.  For this reason, it will be deprecated in the
next version (1.7) and replaced with this "textblock" syntax:

#[[  you can put absolutely anything in here ]]#

But until then, #literal() is the best way to do this when the content
is valid VTL.  If it is not, the workaround for 1.6 and earlier is to
put the content in a separate file and use #include to bring it in.

Just FYI

On Wed, Mar 11, 2009 at 1:30 AM, bluejoe <bluejoe2...@gmail.com> wrote:
> Thank you very very ... much!
>
> #literal()...#end is just what I need!
>
> -bluejoe
>
> ----- Original Message -----
> From: <apa...@recks.org>
> To: "Velocity Users List" <user@velocity.apache.org>
> Sent: Wednesday, March 11, 2009 4:11 PM
> Subject: Re: Is there any way to print a block of text without any rendering 
> in Velocity template?
>
>
>> Hi,
>>
>> there is a #literal()...#end directive for this in newer Velocity versions.
>> See:
>> http://velocity.apache.org/engine/releases/velocity-1.6.1/user-guide.html#stringliterals
>>
>> Hope this helps,
>> Christoph
>>
>> bluejoe wrote:
>>> In Velocity template, is there any way to print a block of text without any 
>>> rendering? For exmaple, I want to process such text as below:
>>>
>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>  hello, $user.name!
>>>
>>>  #noparse
>>>
>>> This text is formatted
>>>    exactly
>>>       as
>>>          it
>>>       is
>>>    typed.
>>>
>>>    using $user.name to get current user's name.
>>>
>>>  #end
>>>
>>> when be rendered, I expect it looks like:
>>>
>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>  hello, bluejoe!
>>>
>>> This text is formatted
>>>    exactly
>>>       as
>>>          it
>>>       is
>>>    typed.
>>>
>>>    using $user.name to get current user's name.
>>>
>>>
>>> Is there any directives in VTL? I need your help.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
>> For additional commands, e-mail: user-h...@velocity.apache.org
>>

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

Reply via email to