Java Reference
In-Depth Information
layout.jsp
<s:layout-definition>
Header: ${title}
<div><s:layout-component name="body"/></div>
Footer
</s:layout-definition>
renderer.jsp
<s:layout-render name="/layout.jsp"
title="My Title">
<s:layout-component name="body">
Hello, reusable layout
</s:layout-component>
</s:layout-render>
result
Header: My Title
<div>Hello, reusable layout</div>
Footer
Figure 7.1: The Stripes reusable layout tags
7.1
Basic Stripes Layout Concepts
Look at the example illustrated in Figure 7.1 . Stripes reusable layouts
come down to three tags and four concepts:
Layout: A template that can be reused for multiple pages. To indicate
that a JSP defines a layout, just wrap the contents with opening
and closing <s:layout-definition> tags.
Renderer: A page that uses a layout to produce a result. Use the
<s:layout-render> tag with the path to the layout JSP in the
name= attribute to render the layout. Starting with a forward slash
( / ), write the path relative to the web application's root directory.
 
 
 
 
Search WWH ::




Custom Search