Why do I need SiteMesh when I have Includes, CSS or XSLT?
Includes, CSS and XSLT are great technologies and I often use them in conjunction with SiteMesh.
However, as mean of separating content from presentation they all have some distinct issues that SiteMesh overcomes.
Include technology requires the content to be aware and directly tied to the presentation. Furthermore, it often results in a fragmented presentation.
Cascading Style Sheets also requires the content files be tied to the presentation (every content file that needs to be decorated requires a CSS reference).
However, the biggest disadvantage drawback to CSS is that it is a look and feel technology. CSS has no way of externalizing reusable components of a website like the menu, search box or footer.
As such CSS is more of a complementing technology to SiteMesh than a comparison point.
XSLT is slow to process, hard to debug and difficult to learn because it requires advanced skills in all areas of development.
In practice the challenges of skill sets, deadlines and budget often result in XSLT not making the cut.
SiteMesh is simple because it does not change the overall technology and allows clear deliniation of roles.
The Content Developers focus only on the content. There are no reference points to the presentation. Clear roles allows respective Developers to focus on their area of expertise.
Because of the decoupling, the presentation layer can be changed independent of the content. SiteMesh even allows specific presentation decorator files be applied by url pattern or even dynamically.