Setup of SiteMesh is a very straightforward process.

Importing sitemesh-blank.war

The quickest way to configure SiteMesh is to simply import sitemesh-blank.war.

Install SiteMesh Manually

Manually installing SiteMesh into your web application consists of three steps,

  1. Add the SiteMesh library file to WEB-INF/lib
  2. Add the SiteMesh filter to web.xml
  3. Create a blank decorators.xml file

Setup Library File

Copy the SiteMesh jar file into your web application's WEB-INF/lib directory. In this example we downloaded SiteMesh 2.4.1 which uses the jar name, sitemesh-2.4.1.jar.

Add SiteMesh Filter

Add the following to WEB-INF/web.xml within the <web-app> tag,

<filter>
	<filter-name>sitemesh</filter-name>
	<filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class>
</filter>

<filter-mapping>
	<filter-name>sitemesh</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>

Create the a decorators.xml file in your WEB-INF directory,

<decorators>
</decorators>