Inheritance

As mentioned before, a panel may explicitly extend a toplevel panel by specifying the super attribute. A derived panel extends its base panel in the following ways:

During instantiation, these rules are to be applied when resolving attributes, subpanels, parameters and lists in the current panel.

Let us examine an example to make this clear:

<panel name="/base">
  <panel name="nested">
    <param name="param1"/>
    <param name="param2" value="p2"/>
    <panel name="nested1nested"/>
  </param>
</panel>

<panel name="/derived" super="/base" template="/WEB-INF/derived.jsp">
  <panel name="nested" template="/WEB-INF/nested1.jsp">
    <param name="param1" value="p1"/>
    <param name="param2" value="override p2"/>
    <param name="param3" value="add p3"/>
  </param>
  <panel name="nested2" template="/WEB-INF/nested2.jsp"/>
</panel>

<panel name="/concrete" template="/WEB-INF/derived2.jsp">
  <panel name="foo" super="/derived">
    <panel name="nested">
      <panel name="nested1nested" template="/WEB-INF/bar.jsp"/>
      <param name="param3" value="override p3"/>
    </panel>
  </panel>
</panel>

Don't run away! It looks harder than it is... Let's work out what happens here: