Velocity Users Guide

The Jakarta Velocity Developers

Version 1.5


Table of Contents

1. Preface
1.1. About this Guide
1.2. Acknowledgements
1.3. Feedback
2. What is Velocity?
2.1. The Fruit Store Example
2.2. Velocity Template Language (VTL): An Introduction
2.3. Hello Velocity World!
3. Language elements
3.1. Statements and Directives
3.2. References
3.3. Comments
3.4. Escaping VTL elements
4. References
4.1. Identifiers
4.2. Variables
4.3. Properties
Default property lookup rules
4.4. Methods
4.5. Reference Miscellany
Separating Identifiers and template text
Quiet reference notation
5. Directives
5.1. The #set directive
Assigning null values to references
String Literals
5.2. The #literal Directive
5.3. Conditionals - #if/#elseif/#else
5.4. Loops - #foreach
5.5. Loading resources
File inclusion - #include
Template inclusion - #parse
5.6. Stop template rendering - #stop
6. Operators
6.1. The AND Operator
6.2. The OR Operator
6.3. The NOT Operator
7. Velocity Macros
7.1. Velocimacro Arguments
7.2. Velocimacro Properties
7.3. Velocimacro Trivia
8. Formatting Issues
9. Other Features and Miscellany
9.1. Math
9.2. Range Operator
9.3. Advanced Issues: Escaping and !
9.4. Velocimacro Miscellany
9.5. String Concatenation