Search code examples
spring-mvcdecoratorsitemesh

Pattern matching using decorators


I want to define a specific URL pattern using Sitemesh decorators.xml. I want to define a decorator that matches all URLs ending with "/story/_NUMBER_" to be targetted by the decorator. I tried:

 <decorator name="customMain" page="customMain.jsp">
        <pattern>/story/[0-9]+</pattern>
 </decorator>

But this does not work.. Do regular expressions work in decorators.xml? If not, how do I target URLs that end with the above pattern?


Solution

  • Just ran into this myself. I don't think it's possible to use regular expressions at all. Only wildcard patterns with * and ?.

    Look at the source here for more details.