SiteMesh
is an open-source layout and page decoration framework from the OpenSymphony project. It was originally created over 5 years ago, when Joe Walnes downloaded the first Sun servlet engine and wrote it using servlet chains. Over the years, the basic design has stayed the same; content is intercepted and parsed, and a decorator mapper finds a decorator and merges everything. The figure below shows a simplistic example of how this works.
Skinning is an essential element to every web application. The ability to edit one or two files to change the entire layout of an application is necessary for maintainability. SiteMesh is a simple decoration framework and is very easy to install and configure.
To learn more about SiteMesh, see the following articles:
For the first couple years, AppFuse used Apache Tiles for its templating framework. Since Tiles didn't work with all the frameworks AppFuse supports, we switched to SiteMesh
. The transition was fairly easy
.
The menu selection logic in AppFuse is done using SiteMesh and a form of dependency injection
.