I have the following tiles configuration file
<tiles-definitions>
<definition name="base" template="/includes/layout.jsp">
<put-attribute name="header" value="/includes/header.jsp" />
<put-attribute name="menu" value="/includes/menu.jsp" />
<put-attribute name="footer" value="/includes/footer.jsp" />
</definition>
<definition name="home" extends="base">
<put-attribute name="contentBody" value="/home/view.jsp" />
</definition>
</tiles-definitions>
and to display "view.jsp" page I have another page called "home.jsp" and it has the following code (only)
//home.jsp
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<tiles:insertDefinition name="home" />
and the problem here is, If i want to load "edit.jsp" page with same layout, I need to repeat this part in tiles.xml
<definition name="editbase" extends="base">
<put-attribute name="contentBody" value="/home/edit.jsp" />
</definition>
and create a file called "editbase.jsp" and call it. (repeating the above code)
I'm just wondering is this the correct way or can I do something like
<tiles-definitions>
<definition name="base" template="/includes/layout.jsp">
<put-attribute name="header" value="/includes/header.jsp" />
<put-attribute name="menu" value="/includes/menu.jsp" />
<put-attribute name="footer" value="/includes/footer.jsp" />
</definition>
<definition name="home" extends="base">
<put-attribute name="contentBody" value="/home/view.jsp" />
<put-attribute name="contentBody" value="/home/edit.jsp" />
</definition>
</tiles-definitions>
and load the page accordingly.. I think my question is clear
I'm using apache tiles 2.2.2
thanks in advance
cheers
sameera