This tutorial teaches you how to setup SiteMesh within a web application and should take about 5 minutes or less.
Shortcut: Don't have a development environment handy or know how to set one up? Download the SM Starter Package which contains SiteMesh with all the exmaples in a pre-configured development environment. Best of all, no install necessary, just unzip and run.
Installing SiteMesh into your web application consists of three steps,
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 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,
If you start up your application server (container) and get no errors then SiteMesh is is ready to go. However, SiteMesh will not do anything yet. Continue to Start Using SiteMesh in 10 minutes.