It's not a secret anymore!
The moose likes Struts and the fly likes nested tiles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "nested tiles" Watch "nested tiles" New topic

nested tiles

Stefan Closs

Joined: Dec 15, 2003
Posts: 10
using struts 1.2 and tomcat 5

i want to develop nested tiles.
I found no documentation about usage.

bodyFrame.jsp put an parameter body.
But it don�t works. body isn�t displayed. Have any suggestions?

My 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 name="startpage" extends="defaultLayout">
<put name="body" value="/startpage.jsp" />

<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<%-- 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 ut name="body" type="page" /> <-- here i put the body

<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<div id="backgrounddiv">
<div id="header">
<div id="globalcontainer">
<tiles:insert name="bodypage" /> <-- this istn�t displayed
Divyesh Patel

Joined: Dec 01, 2004
Posts: 2
Your struts-config.xml should look something like

<action path="/myPage" type="Package.SomeAction">
<forward name="start" path="startpage"/>

Your class should have

ActionForward forward = mapping.findForward("start");

From Browser you need to use URL

If you are not sure how this works then look at article below and concentrate on Solution 6 and 7.
I agree. Here's the link:
subject: nested tiles
It's not a secret anymore!