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.
"PoweredByVelocity". Velocity Wiki. Wiki.apache.org. 2009-12-30. Archived from the original on 23 March 2010. Retrieved 2010-03-29. https://wiki.apache.org/velocity/PoweredByVelocity ↩