• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

nested tiles

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
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>

<definition name="startpage" extends="defaultLayout">
<put name="body" value="/startpage.jsp" />
</definition>


layout.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
</tiles:insert>


bodyFrame.jsp
---------------------------
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<div id="backgrounddiv">
<div id="header">
<h1>Community</h1>
</div>
<div id="globalcontainer">
<tiles:insert name="bodypage" /> <-- this istn�t displayed
</div>
</div>
</body>
</html>
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your struts-config.xml should look something like

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


Your SomeAction.java class should have

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


From Browser you need to use URL
http://......../myPage.do

If you are not sure how this works then look at article below and concentrate on Solution 6 and 7.
http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.html
 
Don't touch me. And dont' touch this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!