JPT is a Java implementation of Zope Page Templates
About 6 months ago I was introduced to Zope, an open source web application framework written in Python which, when combined with some of the content management interfaces that have been written for it, is a very powerful platform for creating custom web applications. One of the things I liked most about Zope was its templating scheme, Zope Page Templates (ZPT). For the most part the company I work for is a Java shop and we've been using XSLT for several years now as our user interface technology of choice. After using ZPT, I began to see some advantages to using something like ZPT instead of XSLT for user interface design.
Some links:
Two of the key ways that ZPT is easier to deal with than XSLT are:
Although our company is doing more work in Zope these days, it's clear we're still going to be using Java for some time to come for certains applications. So, of course, I looked around to see if there was a Java implementation of ZPT. I did find the javazpt project on Source Forge, but I didn't care for the way the Context was handled, essentially forcing you to popuplate a map or series of maps as the Context against which to process the template. One of the ways ZPT is powerful is in it's simplicity, so it was within reach to implement my own processor.
The context against which the template is processed may be any arbitrary Java object. A path in a path expression corresponds to a traversal of that object's properties and methods, found using bean introspection and reflection respectively. This allows powerful direct access by the template of any arbitrarily complex graph of business objects, without having to prepare those objects in any special way for rendering. Any public bean property or method of any arbitrary object may be accessed. At the time of this writing all "tal" and "metal" attributes are implemented, with the exception of "tal:on-error". (Coming soon.) Due to differences between doing template processing inside the Zope framework in python and doing them in Java, the expression syntax, TALES, and path expressions in particular, are a bit different from ZPT. Differences between ZPT and JPT are discussed in the user's guide.