Luke
Luke

Reputation: 1209

Apache Velocity $ vs $!{}

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

Upvotes: 16

Views: 8427

Answers (1)

brianegge
brianegge

Reputation: 29872

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.

Upvotes: 25

Related Questions