16

For apache velocity, is there a difference between accessing variables with $ vs. $!{}. If so, what is it?

Luke
  • 1,209
  • 2
  • 10
  • 7

1 Answers1

25

There's two differences, the second is formal and quiet.

Formal reference notations include the braces around the variable. The quiet notation includes the ! and means to output nothing if the reference does not exist. When combining them, you create a formal and quiet notation.

starwarswii
  • 2,187
  • 1
  • 16
  • 19
brianegge
  • 29,240
  • 13
  • 74
  • 99