Sitemesh布局

3

Stripes web框架包含一个布局引擎,提供以下功能:

布局定义文件 - layout.jsp

<s:layout-definition>
  Header
  <div><s:layout-component name="body"/></div>
  Footer
</s:layout-definition>

使用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

在布局定义中,我指定了组件的位置,页面定义了该组件的内容。我正在寻找Sitemesh中等效的功能,我正在Grails应用程序中使用它。
看起来Sitemesh只允许您定位(或装饰)整个页面正文。有没有办法像上面那样定位更精细的内容元素?
1个回答

1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接