Skip to content

Templating Basics

tporcham edited this page Jan 30, 2019 · 2 revisions

Templates are very simple to write. The are comprised of any string of text, and are decorated using orb-tags.

The Orb Tag

Orb tags are comprised of a preceding @ character, followed by {...} brackets which contain regular MVEL expressions.

My name is: @{name}

In this template, we have a simple property expression in our orb-tag, which returns the value of name. So if we were to inject a variable called name, or provide a Context Object that contains the field name and evaluate this template, we'll get something like this back:

My name is: Jane Doe

It's pretty simple.

Whitespace handling

MVEL Templates preserve all whitespace, so keep that in mind, depending on the type of document that you are creating.

See also