Apache Velocity

Apache Velocity first released in April 2001, is a Java-based template engine that provides a template language to reference objects defined in Java code.

It aims to ensure clean separation between the presentation tier and business tiers in a Web application (the model–view–controller design pattern).

Jon Scott Stevens derived the name from the AltiVec Velocity Engine in the PowerPC G4 chip.

Some common types of applications that use Velocity are: The following template: processed by Velocity produces the following HTML:

Another example using conditions:AWS API Gateway body mapping template, for DynamoDB HTTP:Another example with optional array; without condition will fail because of invalid resulting JSON:The syntax and overall concept of the Apache Velocity templates is similar to the syntax of the older WebMacro template engine, which is now also an open source project.

AWS API Gateway body mapping template
AWS API Gateway body mapping template.