struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Velja Radenkovic <>
Subject Re: Tiles in Frameset
Date Thu, 02 Sep 2004 15:05:07 GMT
On Thu, 2 Sep 2004 06:43:25 -0700 (PDT), Caroline Jen
<> wrote:
> How do I display tiles in columns in the browser?
> I have been using tiles feature of the Struts
> framework, and the tiles are displayed in the browser
> in "rows".  This is my setup (which works fine):
> <tiles:get name="banner"/>
> <tiles:get name="upperbar"/>
> <tiles:get name="content"/>
> <tiles:get name="lowerbar"/>
> Now, the third row has two columns; the column on the
> left is a pane with a number of links.  All my web
> pages will show this column.  The column on the right
> is the content, which varies page by page.
> How do I modify my setup for the third row to have two
> columns?
> _______________________________
> Do you Yahoo!?
> Win 1 of 4,000 free domain names from Yahoo! Enter now.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
I think that You are missing something. 

First create one jsp page (baseLayout.jsp) you can call it whatever You like

<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
          <tiles:insert attribute="col1"></tiles:insert>
           <tiles:insert attribute="col2"></tiles:insert>
             <tiles:insert attribute="col3"></tiles:insert>

Than in Your Tiles definitions (tiles-def.xml) file define your
baseLayout like this.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD
Tiles Configuration 1.1//EN"
	<definition name="baseLayout" page="/WEB-INF/layouts/baseLayout.jsp">
           	<put name="col1" value="/firstColumn.jsp" />
    		<put name="col2" value="/secondColumn.jsp" />
    		<put name="col3" value="/thirdColumn.jsp" />

Than create other pages and make them use your base layout.

<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<tiles:insert page="/WEB-INF/layouts/baseLayout.jsp">
  <tiles:put name="col1" value="/leftMenu.jsp">
  <tiles:put name="col2" value="/body.jsp">
  <tiles:put name="col3" value="/bannerBar.jsp">

Please do not try to put this code to work before you read the docs
carefully. It will cost you mutch more time and again you will be
I wrote it just to make you shure that tiles will display wherever You
want them (baseLayout.jsp).

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message