views:

71

answers:

1

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

+1  A: 

There's two differences, second 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.

http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html

brianegge