Gracelets is the fusion of two mainstream technologies,
Groovy +
Facelets/
JSF.
It allows Groovy scripts to be used instead of XHTML/JSP views, Facelet tag libraries and JSF component libraries. Gracelets has
also been described as a DSL (Domain-Specific Langage) for
JSF/Facelets.
Gracelets has the goal of facilitating development of web based applications using the Java Server Faces framework. It allows
one to use many Groovy language features (like
closures)
as complements and/or replacements for some JSF/Facelets features (like
EL)
that can become very cumbersome and restrictive in many scenarios.
If you are familiar with JSF/Facelets and Groovy you can skip the rest of this article and continue on to the
next section.
It is beyond the scope of this manual to describe in detail JSF, Facelets and Groovy. Thus if you do not know much about any or all of these
great technologies please follow the links above where they are first mentioned to begin learning about them.
That said, with the following we will attempt to demonstrate some of the benefits of using Gracelets when using these technologies. JSF/Facelets provide a powerful
component-based and templating technology. Groovy simplifies programming in the Java language by providing advanced features which allow one to practically accomplish
the same task without as much boiler-plate code as in regular Java and allowing java code to be hot-reloadable and more loosely coupled with the surounding framework.
As you can imagine, combining these technologies provides for many productive possibilities resulting in less time coding, more options for prototyping and testing
and a greatly facilitated component development and templating complementing JSF/Facelets.
A few examples will illustrate this.
Views & Controllers
Templating
Component Development