FreeMarker provides simple data binding support, but it's still flexible. Templates are bound to data via a tree data model.
The data model is built using Java as demonstrated here. The demo simply constructs the tree using a combination of values and hash tables. However, the data model itself is represented as a series of Java Interfaces, thus allowing any data backend. In the demo, the values and hash tables are automatically adapted to support the Java Interfaces. The interfaces are detailed here.
Basically, almost any data source can be bound, such as SQL ResultSet. Popular POJO binding is provided out-of-the-box. But, advanced examples such as the XML Node binding as described here are also possible.
An interesting concept is the notion of a method. This provides dynamic capability, and could possibly be used to extend the tree data model template rendering time.
There's support for using FreeMarker in the web-tier as described here. It's possible to use JSP tags in FreeMarker templates, and use FreeMarker templates in JSP, although how well this actually works has to be tested.
Create tree data model via custom code against our Java API (as per starter examples in FreeMarker)
Develop custom TemplateInterface adaptors against Alfresco Node & QueryResult concepts
Transform Alfresco model / resultset to XML
Bind against Web-tier Repository POJO classes
Template use-cases? Each use-case drives the data binding
Alternative Web Client Views (e.g. property, space)
Microsite for a project space
Should we investigate providing a JSP tag library for use in any JSP templating environment?