SiteMesh SiteMash is a similar system for page templates, but can be done without xml. This is especially nice if you have one or two main templates that you constantly use, you do not need to create an XML record for each of them. This is currently the default template system in Grails. Sitemesh 3 has some nice additions, but at the time of this writing, itβs stuck in beta with almost zero documentation. It uses a decorator pattern, as seen in all tile comparisons against sitemesh.
Alternatively, if you are willing to give up jsp, you can give JSF 2.0, which has very impressive template capabilities without the need for xml. This, along with the server-side code model of JSF, will certainly help reduce duplicate code. (As a bonus, the Primefaces component library for JSF 2.0 is one of the most impressive component / widget sets.)
source share