.

사이트메쉬 WEB.xml설정 및 decorators.xml설정 예

<web.xml 예>
 <filter>
  <filter-name>sitemesh</filter-name>
  <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
 </filter>

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

<decorators.xml 예>
<?xml version="1.0" encoding="ISO-8859-1"?>
<decorators defaultdir="/chapter10/sitemesh/decorators">
    <!-- Any urls that are excluded will never be decorated by Sitemesh -->
    <excludes>
        <pattern>/debug.jsp</pattern>
        <pattern>/style/*</pattern>
        <pattern>/script/*</pattern>
        <pattern>/img/*</pattern>
        <pattern>/dojo/*</pattern>
        <pattern>/struts/*</pattern>
        <pattern>/exclude.jsp</pattern>
        <pattern>/exclude/*</pattern>
    </excludes>

    <decorator name="layout" page="layout.jsp">
        <pattern>/sitemesh*</pattern>
    </decorator>
   
    <decorator name="panel" page="layoutPanel.jsp"/>
    <decorator name="header" page="layoutHeader.jsp"/>
    <decorator name="footer" page="layoutFooter.jsp"/>   
</decorators>

<sitemesh.xml 예>
<sitemesh>
    <property name="decorators-file" value="/WEB-INF/decorators.xml"/>
    <excludes file="${decorators-file}"/>

    <page-parsers>
        <parser content-type="text/html" class="com.opensymphony.module.sitemesh.parser.FastPageParser"/>
    </page-parsers>

    <decorator-mappers>

        <mapper class="com.opensymphony.module.sitemesh.mapper.PageDecoratorMapper">
            <param name="property.1" value="meta.decorator"/>
            <param name="property.2" value="decorator"/>
        </mapper>

        <mapper class="com.opensymphony.module.sitemesh.mapper.FrameSetDecoratorMapper">
        </mapper>

        <mapper class="com.opensymphony.module.sitemesh.mapper.AgentDecoratorMapper">
            <param name="match.MSIE" value="ie"/>
            <param name="match.Mozilla [" value="ns"/>
            <param name="match.Opera" value="opera"/>
            <param name="match.Lynx" value="lynx"/>
        </mapper>

        <mapper class="com.opensymphony.module.sitemesh.mapper.PrintableDecoratorMapper">
            <param name="decorator" value="printable"/>
            <param name="parameter.name" value="printable"/>
            <param name="parameter.value" value="true"/>
        </mapper>

        <mapper class="com.opensymphony.module.sitemesh.mapper.RobotDecoratorMapper">
            <param name="decorator" value="robot"/>
        </mapper>

        <mapper class="com.opensymphony.module.sitemesh.mapper.ParameterDecoratorMapper">
            <param name="decorator.parameter" value="decorator"/>
            <param name="parameter.name" value="confirm"/>
            <param name="parameter.value" value="true"/>
        </mapper>

        <mapper class="com.opensymphony.module.sitemesh.mapper.FileDecoratorMapper">
        </mapper>

        <mapper class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper">
            <param name="config" value="${decorators-file}"/>
        </mapper>

    </decorator-mappers>

</sitemesh>

.