O'Reilly logo

Liferay User Interface Development by Frank Yu, Xinsheng Chen, Jonas X. Yuan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Velocity template language

Let us briefly review the syntax of the Velocity Template Language (VTL).

Statements and references

Here is a VTL statement:

#set ($me = "Velocity")

A VTL statement begins with a # sign. The word set is a directive. In VTL, a reference begins with a $ character. So $me is a reference, a variable reference in this case. The $me variable is assigned the value of Velocity. Velocity is a string. In VTL a string can be enclosed in single or double quotes. A string in single quotes will be interpreted literally while a string in double quotes can contain variables that will be substituted with their values when the template is merged.

There is another way of using references:

$witness.getMessage()

Here we use a reference to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required