Skip to content
sitemesh edited this page Sep 13, 2010 · 1 revision

Significant changes since SiteMesh 2

New stuff

  • [+] Indicates this is done.
  • [/] Indicates partially done.
  • [-] Indicates not yet done, but will be for the release.

[+] Improved performance and memory usage

Thanks to a change in the design of the underlying content processor, SM3 performs roughly three times the speed of SM2, with roughly half the memory overhead.

[+] Decoupling from page genrator technologies

While SM2 was always agnostic to what generated the content of the website, it was coupled to particular technologies for rendering the decorator (typically JSP, but also FreeMarker, Velocity, Tapestry, etc through extensions).

SM3 changes this. The decorators are now rendered by special tags that can appear in the output of any technology. This removes the need for tight technology integration and even means you can use static .html files for building decorators.

[+] Decorator chaining

Decorators can now be chained together in a website. That is, a content can be decorated, then decorated again (and again). And thanks to the new design of the content processor – the content does not need to be processed more than once.

For example: mypage.html → two-column-decorator.html → common-look-and-feel-decorator.html

[/] Configure it your way

Want to configure purely through Java code, through XML, through Spring, or maybe by convention? It’s your choice. And it’s easy to plug in your own configuration mechanism.

[+] Offline site generation

SiteMesh comes with tools to allow you decorators to content for static websites as an offline task.
Can be used to cut the cost of hosting (no Java runtime needed on servers) or simplify distribution (e.g. include web-site as part of a downloaded package).

Because the offline generator can share the same configuration as an online website, it’s also possible to mix and match (e.g. pre-process the static parts of a website, but decorate the dynamic parts at request time).

[+] Code modernization

Under the hood, over 10 years worth of cruft has been cleaned up. This means a simpler API. And many long-standing design decisions have been revisited, which has made the things above possible, and opens the possibility of your own extensions.

The various extension APIs have been revisited to make the easier to understand, with useful hooks and clear documentation.

[+] Reusable core building blocks

Many of the underlying building blocks of SiteMesh are useful to other applications. These have been decoupled from the code, allowing you to reuse them in your own application, even if you don’t intend to use SiteMesh.

The ContentBufferingFilter is a reusable Servlet Filter that intercepts responses and allows modifications to be made to the content.

The HTML TagProcessor is a high-performant and extensible tag parser that allows for extraction and transformations of content.

[-] Frontend proxy

A SiteMesh web-application can act as a proxy to other web-sites. Decorating content from non-Java web-servers and compose content (and decorators) from many sources onto a single page.

The proxying functionality includes an external request forwarder, parallelized loading pipeline (so all sources can be fetched in parallel to improve throughput) and integration with JCache enabled caching products.

[+] Licensed under the Apache Software License v2.0

SM2 was licensed under the OpenSymphony Software Licence v1.1. SM3 is under the Apache Software License v2.0. This license is used much more widely and approved by many organizations.

Caveats

In order to make the new features above possible, some older functionality had to go.

  • Requires at least JDK 5 and a container that supports the Servlet 2.5 specification, because of it’s reliance on new language features, libraries and spec clarifications.
  • Backwards compatibility has been broken. However it will be possible to run both SM2 and SM3 at the same time on an application to allow for incremental migration.