References: Variables, Properties and Methods.
Remember that:
References begin with $ and are used to get something. Directives begin with # and are used to do something.
So, references are all those items that start with $.
Variables.
A variable is an Identifier starting with $. For example $name is a variable (‘name’ is the identifier).
A VTL Identifier must start with an alphabetic character (a .. z or A .. Z).
The rest of the characters are limited to the following types of characters:
- alphabetic (a .. z, A .. Z)
- numeric (0 .. 9)
- hyphen (“-”)
- underscore (“_”)
Here are some examples of valid variable references:
- $foo
- $mudSlinger
- $mud-slinger
- $mud_slinger
- $mudSlinger1
Properties.
Properties have a distinctive format and starts with “.” dot.
Here are some valid properties:
- $customer.Address
- $user.Password
- $car.Speed
In this example $customer.Address, $customer is a reference to a JAVA object and .Address is a property of that object.
So, using $customer.Address will produce output containig value of Address property of customer object.
Methods.
Properties and Methods have similar format with difference that Methods accept parameters, and this occurs in brackets.
Here are some valid methods:
- $customer.getAddress()
- $calculator.sum(1,2)
- $page.setTitle(“Home Page”)
Properties can be used as a shorthand for some methods.
$customer.Address and $customer.getAddress() has the exact same effect.
It is generally preferable to use a Property when available. The main difference between Properties and Methods is that you can specify a parameter list to a Method.
Formal Reference Notation
Examples listed above use a shorthand notation. But there is also a formal notation.
In some cases the formal notation is required for correct processing.

Quiet Reference Notation
When Velocity encounters an undefined reference, its normal behavior is to output the image of the reference.
For example, suppose you have this:
<input type="text" name="email" value="$email"/>
where $email is not defined. Velocity will print “$email” String into your output.
If you prefer an empty String instead of “$email” in your output, you can use the quiet notation like this:
<input type="text" name="email" value="$!email"/>
Using $!email will produce an empty string if $email is not setted.
Formal and Quit Notation can be used tohether:
<input type="text" name="email" value="$!{email}"/>
References: example of case substitution

Above examples illustrate three cases of equivalent statetements. These are alternative uses of the same references.