Need help with sitemesh2?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

126 Stars 85 Forks Other 474 Commits 29 Opened issues


SiteMesh 2: Official repository

Services available


Need anything else?

Contributors list

** OpenSymphony SiteMesh 2.5 **

SiteMesh is a web-page layout system that can be used to abstract common look and feel from the functionality of a web-application and to assemble large webpages from smaller components. Pages and components can have meta-data extracted from them (such as body, title and meta-tags) which can be used by decorators (skins) that are applied.

SiteMesh won't tread on your toes or force you to work in a certain way (except for cleaner) - you install and carry on working as before. It seamlessly fits in with existing frameworks.

Forget the hype - just try it! You'll be impressed with how it can simplify things.

-- Obtaining --

The latest version of SiteMesh can be obtained from:

-- Requirements --

SiteMesh requires a Java Servlet container conforming to the Servlet 2.3 specification. Versions prior to 2.3 are not enough.

Currently known containers that support this and SiteMesh was tested with:

  • Orion 1.5.4 and up -
  • Tomcat 4.0, 4.1 and 5.0.19 -
  • Resin 2.1.11, 2.1.12, 2.1.13 and 3.0.7 -
  • Oracle OC4J 2 -
  • WebLogic 7.0 SP2, 8.1 and 8.1 SP2 -
  • WebSphere 5.0 -
  • Jetty 4.2.20 -

-- Installation --

  • Copy [email protected]@.jar to the WEB-INF/lib/ directory of your web-app.

  • OPTIONAL: Copy sitemesh.xml to the WEB-INF/ directory if you need to specify a custom decorator mapper configuration then the default configuration.

  • Add the following to WEB-INF/web.xml:

    sitemesh com.opensymphony.sitemesh.webapp.SiteMeshFilter

    sitemesh /*

    • ORION USERS ONLY. For performance reasons, Orion does not auto-load tab library descriptors from Jars by default. To get passed this you will also have to copy sitemesh-decorator.tld and sitemesh-page.tld to WEB-INF/lib and add the following to WEB-INF/web.xml: /WEB-INF/lib/sitemesh-decorator.tld /WEB-INF/lib/sitemesh-page.tld

-- Getting started --

Ok, let's assume you have some basic JSPs already on the site. These should contain vanilla HTML.

If you don't, here's a JSP to get you started (test.jsp).

    <title>Hello world</title>

    <p>Today is .</p>

Once you have some content (preferably more imaginative than the example above), a decorator should be created (decorator.jsp).

    <title>My Site - <title default="Welcome!"></title>

Now you need tell SiteMesh about that decorator and when to use it. Create the file WEB-INF/decorators.xml:

<decorator name="mydecorator" page="/decorator.jsp">

Access your original JSP (test.jsp) though your web-browser and it should look pretty normal. Now if you add some styling to your decorator it shall automatically be applied to all the other pages in your web-app.

You can define as many decorators as you want in decorators.xml. Example:

<decorator name="default" page="default.jsp">

<decorator name="anotherdecorator" page="decorator2.jsp">

<decorator name="htmldecorator" page="html.jsp">

<decorator name="none">
    <!-- These files will not get decorated. -->

-- Further support --

You get the idea. Play around. See the SiteMesh website for full documentation.

-- Credits --

Thank these guys: * Mathias Bogaert [email protected] * Mike Cannon-Brookes [email protected] * Victor Salaman [email protected] * Joseph Ottinger [email protected] * Hani Suleiman [email protected] * Scott Farquhar [email protected] * James Roper [email protected] * Matt Quail [email protected] * Charles Miller [email protected]

                                        - Joe Walnes 

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.