title: sitemesh and spring MVC decorator pattern problems
body: <p>I have sitemesh with spring working, this is the configuration:
  decorator.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;decorators defaultdir="/styles"&gt;
      &lt;excludes&gt;
          &lt;pattern&gt;/exclude.jsp&lt;/pattern&gt;
          &lt;pattern&gt;/exclude/*&lt;/pattern&gt;
      &lt;/excludes&gt;
      &lt;decorator page="application/themeManager/theme.jsp" name="dos"&gt;
          &lt;pattern&gt;/*&lt;/pattern&gt;
      &lt;/decorator&gt;
  &lt;/decorators&gt;
  </code></pre>
  
  <p>And this is my <strong>web.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
      version="2.4"&gt;
  
      &lt;!-- The master configuration file for this Spring web application --&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;
              /WEB-INF/config/web-application-config.xml
          &lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;!-- Enables Spring Security --&gt;
      &lt;filter&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
  
      &lt;!-- Agregamos el filtro de sitemesh que permite interceptar todas las llamadas que necesitamos --&gt;
      &lt;filter&gt;
          &lt;filter-name&gt;sitemesh&lt;/filter-name&gt;
          &lt;filter-class&gt;com.opensymphony.sitemesh.webapp.SiteMeshFilter&lt;/filter-class&gt;
      &lt;/filter&gt;
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;sitemesh&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
          &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;
          &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;
          &lt;dispatcher&gt;ERROR&lt;/dispatcher&gt;
      &lt;/filter-mapping&gt;
  
      &lt;!-- Loads the Spring web application context --&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;!-- Serves static resource content from .jar files such as spring-faces.jar --&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;Resources Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.js.resource.ResourceServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;0&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;!-- Map all /resources requests to the Resource Servlet for handling --&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Resources Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/resources/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;!-- The front controller of this Spring Web application, responsible for handling all application requests --&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;Spring MVC Dispatcher Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
              &lt;param-value&gt;&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;!-- Map all *.spring requests to the DispatcherServlet for handling --&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Spring MVC Dispatcher Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/spring/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>This work, but when I change the pattern in decorator.xml for something like</p>
  
  <pre><code>&lt;decorator page="application/themeManager/theme.jsp" name="dos"&gt;
      &lt;pattern&gt;/spring/cliente/index&lt;/pattern&gt;
  &lt;/decorator&gt;
  </code></pre>
  
  <p>it doesn't work, I try a lot of combination and nothing.
  Then I change the mapping for the spring servlet in the web.xml like this</p>
  
  <p>
      
          Spring MVC Dispatcher Servlet
          *.htm
      
  
  <p>and define a <strong>new pattern</strong> like this:</p>
  
  <pre><code>&lt;decorator page="application/themeManager/theme.jsp" name="dos"&gt;
      &lt;pattern&gt;/cliente/index.htm&lt;/pattern&gt;
  &lt;/decorator&gt;
  </code></pre>
  
  <p>And it works, so is there any way to make this to work with this mapping for the spring servlet ? </p>
  
  <pre><code>&lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Spring MVC Dispatcher Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/spring/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>