struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Chisholm" <>
Subject RE: Problems getting started with Tiles2/S2
Date Fri, 11 May 2007 18:57:44 GMT

This is a good summary, and I can add one item.  To specify which files to
use for your tiles definition config file, you can add the following to your

        <param-value>tiles-defs-1.xml, tiles-defs-2.xml</param-value>
        <description><![CDATA[Location of the Tiles2 config

The filenames are relative to your web-app root.  Normally these would go in
your WEB-INF folder, and so you would use /WEB-INF/tiles-def.xml.

I'm using org.apache.tiles.listener.TilesListener instead of
org.apache.struts2.tiles.StrutsTilesListener, but the context-param should
be picked up by the latter too.

-- David

-----Original Message-----
From: Rick Schumeyer [] 
Sent: Friday, May 11, 2007 12:50 PM
To: Struts Users Mailing List
Subject: Re: Problems getting started with Tiles2/S2

I can now answer my own question regarding Struts2/Tiles2.  I hope this 
information helps someone else.

I frankly have little grasp of the relationship between S2 and T2, but 
this information here works for me.  If anything is incorrect or 
misleading I would love to know about it.

This information applies to Struts 2.0.6.  This version is only 
compatible with whatever version of tiles is included.  As is stated in 
many places, it does not work with the current latest version of Tiles, 

So, if you are trying to use Tiles 2.0.3 or later...don't read the rest 
of this message.

In your web.xml you will need a section like this:

In the same directory you need a file called tiles.xml (I'm not sure how 
this is found...I saw someone else who has a file called tiles-defs.xml)
THIS IS IMPORTANT:  Use the DTD below regardless of what you see in 
other documentation.

Notice the use of "put" and not "put-attribute" that you may have seen 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"


        <definition name="homeTiles" template="/layout/layout.jsp">
          <put name="title" value="Home"/>
          <put name="header"  value="/test/header.jsp" />
          <put name="menu" value="/test/menu.jsp"/>
          <put name="body" value="/test/home.jsp"/>
          <put name="footer" value="/test/footer.jsp"/>


And in layout.jsp use:

<%@ taglib uri="" prefix="tiles"%>

Combined with statements like:

<tiles:insertAttribute name="header" />

Good luck.

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

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

View raw message