Interesting. I'm not sure why your code doesn't work. Maybe the value attribute in <put name="body" value="/startpage.jsp" /> should be /WEB-INF/pgs/startpage.jsp.

Anyway, I haven't done nested tiles in the same way as you do. This is how I do nested tiles. Maybe someone can comment on which way is better.

<definition name="defaultLayout" template="/WEB-INF/pgs/common/layout/layout.jsp">
<put name="header" value="/WEB-INF/pgs/common/layout/header.jsp" />
<put name="navigation" value="/WEB-INF/pgs/common/layout/navigation/default_nav.jsp" />
<!-- definitions based on this layout must define "body" -->
</definition>


<!-- first define the inner tile -->
<definition name="startpage.body" extends="/WEB-INF/pgs/common/layout/bodyFrame.jsp">
<put name="bodypage" value="/startpage.jsp" />
</definition>


   <!-- then define the whole page by referencing the inner tile -->
  <definition name="startpage" extends="defaultLayout">
      <put name="body" value="startpage.body"  type="definition"/>
  </definition>

Bill

Stefan Clos wrote:

hi,

i have a problem with nested tiles. I found not much about it in the struts doc.
the problem is that it not displays the correct body page.I get a directory listing there.
At the definition startpage i have the value "/startpage.jsp"
This should be displayed at my page. But it doesn´t :(


I am using Struts 1.2 with Tomcat 5.


Thank you all very much for your answers, a link to helpful documentation in the internet,
is also welcome.


Stefan Clos


tiles-def.xml:
-------------------
<definition name="defaultLayout" template="/WEB-INF/pgs/common/layout/layout.jsp">
<put name="header" value="/WEB-INF/pgs/common/layout/header.jsp" />
<put name="navigation" value="/WEB-INF/pgs/common/layout/navigation/default_nav.jsp" />
<put name="bodyFrame" value="/WEB-INF/pgs/common/layout/bodyFrame.jsp" />
</definition>


<definition name="startpage" extends="defaultLayout">
<put name="body" value="/startpage.jsp" /> <--- put the page here
</definition>



layout.jsp ------------------ <%-- Header incl. <body> --%> <tiles:insert attribute="header" />

   <%-- complete navigation --%>
   <tiles:insert attribute="navigation" />

<%-- Rest of the Page (everything after the navigation) --%>
<tiles:insert attribute="bodyFrame" >
<tiles:put name="body" type="page" direct="false" /> <---- put it here
</tiles:insert>



bodyFrame.jsp
--------------------
<div id="backgrounddiv">
<div id="header">
<h1>Community</h1>
</div>
<div id="globalcontainer">
<tiles:insert name="bodypage" /> <------------- should be at this point, but tomcat show me a directory listing there, funny but not what i want
</div>
</div>
</body>
</html>
-------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to