instagram

Apache Velocity Part 6 – include and parse

In velocity template you can import local file using include or you can import other template using parse.

#include – Include content of file in template. template engine is not going to rendered included files.
#parse – Include template in other template. template engine will rendered this file.

Note : #include( “sample.txt”, $sampleFile ) you can use variable to refer file with name.

Find below example :

sample.txt

includeexample.vm

#include sample code :

header.vm

footer.vm

content.vm

#parse sample code

Share