July 2016
Intermediate to advanced
490 pages
10h 54m
English
Velocity uses references to pass dynamic content into web pages. Macros and variables are a few of these references types used to reference objects defined within the Java code or can receive values inside the web page through a VTL declaration. Setting and using objects uses the # character:
#set ($firstName = "Jimmy") #set ($lastName = "Gimme") #set ($age = 35) $firstName $lastName $age
FreeMarker Templating Language (FTL) can define expressions, functions, and macros within the templates and can use a rich library with predefined directives that give us the possibility to iterate data collections, include other templates, and much more. Setting a variable in FTL uses the # symbol:
<#assign firstName = "Jimmy" ...
Read now
Unlock full access