Hello,
I have a tile definition as follows:
<definition name="pageConstructTile" path="/jsp/templates/hscf.jsp">
<put name="title" value="" />
<put name="header" value="/jsp/pageConstruct/header.jsp"/>
<put name="sidebar" value="/jsp/pageConstruct/sidebar.jsp"/>
<put name="footer" value="/jsp/pageConstruct/footer.jsp"/>
<put name="content" value="/jsp/pageConstruct/content.jsp"/>
</definition>
I want the sidebar to reference a list of items to build the menu. I accomplished it
by adding a menu definition and menu.jsp as follows:
<definition name="menu" path="/jsp/pageConstruct/menu.jsp">
<putList name="items">
<item value="Page One"
link="pageOneLink.do"
classtype="org.apache.struts.tiles.beans.SimpleMenuItem" />
<item value="Page Two"
link="pageTwoLink.do"
classtype="org.apache.struts.tiles.beans.SimpleMenuItem" />
<item value="Page Three"
link="pageThreeLink.do"
classtype="org.apache.struts.tiles.beans.SimpleMenuItem" />
</putList>
</definition>
<%@ include file="/jsp/global/init.jsp" %>
<table width='100%'>
<tr>
<td> </td>
</tr>
<%-- Push tiles attributes in page context --%>
<tiles:importAttribute />
<logic:iterate id="item" name="items" type="org.apache.struts.tiles.beans.MenuItem">
<tr>
<td align=center><a href="<%=item.getLink()%>"
class=menuApplications><%=item.getValue()%></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</logic:iterate>
</table>
I then reference the menu definition in sidebar.jsp like this:
<%@ include file="/jsp/global/init.jsp" %>
<tiles:insert definition="menu" flush="true"/>
I was wondering if there would be a way to reference the menu tile definition directly
in sidebar.jsp without having to create the menu.jsp. I hope my question is clear. I
have heard people speak of nested tile definitions, but I have been unable to find an
example.
Any help with this would be greatly appreciated,
Jonathan