The second category of VTL references is properties, which have a distinctive format. The
shorthand notation consists of a leading $
character followed a VTL Identifier,
followed by a dot character (".") and another VTL Identifier. These are examples of
valid property references in the VTL:
$customer.Address
$purchase.Total
Take the first example, $customer.Address
. It can have two meanings. It can
mean look in the hashtable identified as customer
and return the value
associated with the key Address
. But $customer.Address
can also be referring to a method (references that refer to methods will be discussed in
the next section); $customer.Address
could be an abbreviated way of
writing $customer.getAddress()
. When your page is requested, Velocity
will determine which of these two possibilities makes sense, then return the appropriate
value.