|
|||||
|
|||||
Nested Templates
Using the Template Registry you can nest templates inside each other and call them like methods. To call a template inside another template use the 'includeByRef' tag. You must pass any variables used by the nested template via key/value parameters, as shown by the user template parameter in the following example. The following example parses a template which does nothing other than include another template. Recursion is allowed. TemplateRegistry registry = new MVELTemplateRegistry(); registry.registerTemplate("welcomeUser", "Hellow @{user}"); TemplateInterpreter.parse("@includeByRef{helloUser(user = \"bob\")}", base, map, registry); |
|||||
|
Copyright 2003-2006 - The Codehaus. All rights reserved unless otherwise noted.
Powered by Atlassian Confluence
|
|||||