Panels

Panels may be declared as children of a <panels> element using <panel> elements. Since panels may be nested to arbitrary depth, <panel> elements can contain <panel> child elements defining their subpanels.

A <panel> element requires the name attribute. The name must be unique under the <panel>'s siblings. For toplevel panels, the application uses this name like a resource path to instantiate it; for nested panels, the name is used by templates to include a template associated with a subpanel of the current panel. To reflect this, we use the convention to assign path-like names to toplevel panels and identifier-like names to subpanels.

The optional template attribute may be used to specify the associated template.

The optional super attribute can be used to specify a toplevel panel to extend. This is where inheritance comes into play. See the inheritance section for more on this.

Let's illustrate this by giving an example. Consider the following panel definitions:

<panel name="/base.page" template="/WEB-INF/jsp/layout/page.jsp">
  <panel name="header" template="/WEB-INF/jsp/layout/header.jsp"/>
  <panel name="menu" template="/WEB-INF/jsp/layout/menu.jsp"/>
  <panel name="content"/>
  <panel name="footer" template="/WEB-INF/jsp/layout/footer.jsp"/>
</panel>

<panel name="/foo.page" super="/base.page">
  <panel name="content" template="/WEB-INF/jsp/content/foo.jsp"/>
</panel>

To your application, concrete toplevel panels are of particular interest, because they can be instantiated by the controller. Technically spoken, you may dispatch to toplevel panels using their (path-like) names, just as you do with any resources.

Beside subpanels, a <panel> element may contain elements defining parameters and lists.