The Stripes web framework includes a layout engine which provides the following feature:
Layout Definition File - layout.jsp
<s:layout-definition>
Header
<div><s:layout-component name="body"/></div>
Footer
</s:layout-definition>
Page Using layout.jsp
<s:layout-render name="/layout.jsp">
<s:layout-component name="body">
Hello, reusable layout
</s:layout-component>
</s:layout-render>
Generated Content
Header
<div>Hello, reusable layout</div>
Footer
In the layout definition I specify the position of a component and the page defines the content of this component. I'm looking for an equivalent feature in Sitemesh, which I'm using in a Grails application.
It seems that Sitemesh will only only allow one to posititon (or decorate) the entire page body. Is there any开发者_StackOverflow way I can position more fine-grained content elements as above?
If you need more fine-grained content elements, take a look at Sitemesh Content Blocks
精彩评论