|This article does not cite any references or sources. (June 2014)|
According to OpenSymphony, SiteMesh:
- Is a web-page layout and decoration framework and web application integration framework to aid in creating large sites consisting of many pages for which a consistent look/feel, navigation and layout scheme is required
- Intercepts requests to any static or dynamically generated HTML page requested through the web server, parses the page, obtains properties and data from content, and generates appropriate final page with modifications to original—based on Decorator design pattern
- Can also include entire HTML pages as a Panel within another page—similar to Server Side Includes, except HTML document modified to create a visual window (using document's Meta-data as aid) within a page. Using this feature, Portal type web sites can be built very quickly and effectively. This is based upon the well-known Composite design pattern.
- Built on Java 2 with Servlet, JSP and XML technologies. This makes it good for use with Java EE applications, however it can be integrated with non-Java server-side web architectures, like CGI (Perl/Python/C/C++/etc), PHP, and ColdFusion.
- Very extensible, designed for easy extension for custom needs
How it works
SiteMesh uses a Servlet Filter that intercepts the HTML being returned to the web browser, extracting the relevant content and merging it into a template known as the decorator.
SiteMesh was originally developed in 1999 by Joe Walnes. At the time it used Servlet Chains, a feature not part of the standard Servlet specification but supported by some Servlet containers such as Orion Application Server.
In 2000, the first public review of version 2.3 of the Servlet Specification was released, which contained the addition of Servlet Filters. These provided a standardized alternatives to Servlet Chains and SiteMesh was adapted to make use of these instead.
Shortly after this, the decision was made to release SiteMesh as open source software. Joe Walnes and Mike Cannon-Brookes formed the OpenSymphony project to provide a source of Java EE components - the first two consisting of SiteMesh and OSCache.
At this time, SiteMesh had a very small set of users, many of whom got involved in the development of the project. Not long after SiteMesh was originally open sourced, Victor Salaman rewrote the internal HTML parser to produce a 1200% performance increase.