Struts 2.0.18 & Sitemesh

View: New views
1 Messages — Rating Filter:   Alert me  

Struts 2.0.18 & Sitemesh

by RogerV :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Could some kind soul point me towards a definitive guide to installing the SiteMesh plugin - I've found many different variants through Google that give different set-ups although I suspect that this is a conequence of the age of some of the pages.  I'm aware of the conversation http://old.nabble.com/Struts-2.1.8-%2B-SiteMesh-2.4.2-%2B-FreeMarkerPageFilter-Broken-to25721587.html#a25721587 and I've updated the plugin.jar. I've followed the instructions at http://struts.apache.org/2.1.6/docs/sitemesh-plugin.html. My web.xml and decorators.xml are attached below. Needless to say, I'm not getting any decoration at all.

I know that the various jars are being loaded and the decorator.xml is being found because if I rename the decorators.xml and re-boot tomcat then I get errors at startup complaining about the missing decorators.xml

I'm a little confused as to whether I should be using sitemeshes decorator:body style of tags or Freemarkers ${body} syle of tags in my decorator page or whether I can "mix and match", so an example would be appreciated.

I'm also using the spring and convention plugins as well if that's of any relevance.

Regards.

<decorators defaultdir="/WEB-INF/decorators">
        <decorator name="main" page="main.jsp">
                <pattern>/WEB-INF/content/*</pattern>
        </decorator>
</decorators>

web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>Tuner</display-name>
   
   <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
   </listener>

<!--  Filter Structure for SiteMesh -->

<filter>
    <filter-name>struts-cleanup</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
</filter>
<filter>
    <filter-name>sitemesh</filter-name>
    <filter-class>org.apache.struts2.sitemesh.FreeMarkerPageFilter</filter-class>
</filter>
<filter>
    <filter-name>struts</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class>
</filter>

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

</web-app>