5.2 The #literal Directive

The #literal directive allows you to easily use large chunks of uninterpreted content in VTL code. This can be especially useful in place of escaping multiple directives. #literal is a multi-line statement and needs a #end directive to close the statement body.

#literal()
#foreach ($fruit in $basket)
  nothing will happen to $fruit
#end
#end

Renders as:

#foreach ($fruit in $basket)
  nothing will happen to $fruit
#end

Even if the $fruit or $basket references have a value assigned, the text will still be output uninterpreted.

[Caution]Caution

While #literal() suppresses the evaluation of Velocity directives and references at run-time, the body is still parsed. #literal() is not a comment block, if you have a syntax error (e.g. a missing #end) inside the block, Velocity will still report a parse error.