Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Velocity $ vs $!{}

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

like image 582
Luke Avatar asked Dec 30 '09 02:12

Luke


People also ask

Is Apache Velocity deprecated?

Well, the reason is that the Velocity Engine has been deprecated for a while, and a lot of developers around the world need to find well-fitting alternatives. Let's begin and define the set for our test. We will compare the following engines: Apache Velocity.

What is Apache Velocity used for?

Velocity can be used to generate web pages, SQL, PostScript and other output from templates. It can be used either as a standalone utility for generating source code and reports, or as an integrated component of other systems.

What is Apache Velocity Engine?

The Apache Velocity Engine is a free open-source templating engine. Velocity permits you to use a simple yet powerful template language to reference objects defined in Java code. It is written in 100% pure Java and can be easily embedded into your own applications. The engine is the core of the Apache Velocity Project.

What is Velocity .VM file?

Developer file used by Velocity, a Java-based template engine; written using the Velocity Template Language (VTL); contains VTL statements inserted in a normal text document; often used for auto-generating Web source code and class skeletons.


1 Answers

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.

like image 117
brianegge Avatar answered Sep 18 '22 06:09

brianegge