SiteMesh: Giving it another look

After a long break, the Sydney JUG meeting was on again last night and had the privilege of seeing Mike Cannon-Brookes deliver another talk on SiteMesh (he originally spoke about it in the context of java.blogs at SJUG last July.

I gave a thought to investigating it at the time – and got as far as downloading 1.5 and reading the docs (the ones that weren’t marked TODO at least!), but didn’t see the advantages over Tiles.

However, it was good to see it given more attention last night and got to learn about some more advanced features like DecoratorMappers and inline decorators.

It is more obvious now that SiteMesh might be the better solution for us, even in a Struts environment.

The advantages I see in SiteMesh over Tiles are:
– a lot less configuration by applying layouts to a bunch of pages by a pattern, rather than having to cut and paste definitions for each page in tiles (even though they extend a common base, you still need 4 lines per page per skin)
– an easy way to skin by using a ParameterDecoratorMapper to pick a skin (this could easily be replaced with some other technique – we use the domain name of the request). Tiles could do this but I found it quite slow at the time because of the subrequest to select the template JSP, and have just dealt with copying all the defs for each skin up until now.
– the fact that it splits both the template/decorator and the page/fragment content as a complete HTML file that you can style is a big win when you work with a separate team of HTML designers that don’t want to deal with JSP.
– I think it may be faster – I’ll be taking this for a spin today and will report back 🙂

Good luck at the TSS Symposium Mike!

Advertisements

2 responses to “SiteMesh: Giving it another look

  1. Mathias Bogaert

    SiteMesh 1.5? That version is ancient! Use at least 2.0.

  2. Yeah, I picked up 2.0 today 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s