Skip to end of metadata
Go to start of metadata

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.


Will add examples.


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 presentation is still coded by the Presentation Developer in HTML, CSS and JavaScript.  Another key advantage is that the presentation code is not fragmented. However, this is not say that the Presentation Developer can not use Includes or Scriplet technologies for more advanced sites. But even in these cases, the fragmentation of the presentation code is minimal.


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.

  • No labels