I'm using Sitemesh 3 and Freemarker with my Spring MVC application. Freemarker page output is passed to Sitemesh for application of a JSP decorator (will be FTL once I get my config sorted out - I have another SO question about that - as yet unanswered).
I'd got Sitemesh 3 applying the body to the template correctly, now I'd like to add to my setup so an FTL view can set a property that would be rendered in the page heading.
Sitemesh (JSP) template/decorator - this is producing correct output, except for the variable content heading:
<div id="mainWrapper">
<div id="content">
<div id="contentheading"><sitemesh:write property="page.heading"></sitemesh:write></div>
<div>
<sitemesh:write property='body'/>
</div>
</div>
</div>
What do I need to do in my .ftl in order to create some property that would be rendered in the div#contentheading element?
I have a Java config for sitemesh using a custom filter implementation:
public class SitemeshFilter extends ConfigurableSiteMeshFilter {
@Override
protected void applyCustomConfiguration(SiteMeshFilterBuilder builder) {
builder.setMimeTypes("text/html", "application/xhtml+xml");
builder.addDecoratorPath("/*", "/WEB-INF/templates/page.jsp");
}
}
Please note I am using Sitemesh 3