Documentation
Home
Live Examples (new)
Quick overview
Tutorial
Tutorial Live Examples
Download
Installation
User Guide
Javadoc

Tag Library Reference
Tiles Tags

Printer Versions
Quick Overview
Tutorial
User Guide
Overview (old)

Old Documents
Overview (old)

Welcome

Welcome to the Tiles website. This "portal" page is an example of what can be done with Tiles. It is made by assembling Tiles.
You can :

  • Take a glance at some Tiles features and capabilities by browsing the commented live examples (avalaible if you install Tiles)
  • Check the "Quick Overview" for code examples and results
  • Start learning Tiles with the tutorial
  • Learn Tiles Advanced Features (pdf)
  • Read article from javaworld


Tiles Library
Features Overview

Following is an overview of what can be done with Tiles :

  • Screen definitions
    • Create a screen by assembling Tiles : header, footer, menu, body
    • Definitions can take place :
      • in a centralized xml file
      • directly in jsp page
      • in struts action
    • Definitions provide an inheritance mechanism : a definition can extends another one, and override parameters.
  • Templating
    • Tiles framework is entirely compatible with Templates defined by David Geary and implemented in Struts
    • You can replace Templates library by Tiles one
  • Layouts
    • Define common page layouts and reuse them across your web site
    • Define menu layouts, and use them by passing lists of items and links
    • Define portal layout, use it by passing list of Tiles (pages) to show
    • Reuse existing layouts, or define your owns
  • Dynamic page building
    • Tiles are gather dynamically during page reload. It is possible to change any attributes : layout, list of Tiles in portal, list of menu items, ...
  • Reuse of Tiles / Components
    • If well defined, a Tile can be reused in different location
    • Dynamic attributes are used to parameterized Tiles
    • It is possible to define library of reusable Tiles.
    • Build a page by assembling predefined components, give them appropriate parameters
  • Internationalization (i18n)
    • It is possible to load different tiles according to Locale
    • A mechanism similar to Java properties files is used for definitions files : you can have one definition file per Locale. The appropriate definition is loaded according to current Locale
  • Multi-channels
    • It is possible to load different Tiles according to a key stored in jsp session, or anywhere.
    • For example, key could be user provilege, browser type, ...
    • A mechanism similar to Java properties files is used for definitions files : you can have one definition file per key. The appropriate definition is loaded according to the key.

Documentation

tilesAdvancedFeatures.pdf (draft)

Tutorial

Struts in Action (book)

Struts and Tiles aid component-based development (article)

UI design with Tiles and Struts (article)

Programming Jakarta Struts by Chuck Cavaness (book)


News

03 Nov. 2002

TilesPlugin module aware
The TilesPlugin for struts now create one separate definition factory for each struts module.

19 Jul. 2002

Tiles is now in the main branch of Struts1.1 distribution
A Tiles plug-in is available for Struts1.1.

22 May 2002

Tiles Advanced Features Documentation (draft version)
tilesAdvancedFeatures.pdf

Tiles-blank Applications
Different tiles-blanc.war files are now provided to help starting new project using Tiles.

  • tiles-blank.war - Tiles without Struts
  • tiles-blank-struts1.1.war - Tiles with Struts1.1
  • tiles-blank-struts1.0.war - Tiles with latest stable Struts1.0.x

Article on Tiles and Struts
An article on using Tiles and Struts is available at :
http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.html

Dynamic Layout
Dynamic layouts allow a user to customize a site L&F. Check the example to see how to proceed with Tiles.

New Layout : Tabs
The new tabs layout allows to build easily tabs like page : specify which body you want in which tabs, and that all !

Commented Examples
A lot of interesting examples have been revisited and commented in a "portal" fashion. Check "Live Examples" menu entry.

Each Tile can have its own controller !
It is now possible to associate a controller to each Tile. This controller (Java code or struts action) is called immediately before the Tile jsp page. It is useful to prepare data to be shown by jsp page.

Reload Action
There is now a reload action, and a reloadable factory wrapper allowing to reload Tiles configuration files without restarting web server.

Use and Set Bean in configuration file
It is now possible to use and set beans in the configuration file. Such bean can then be set as a <put> or <putList> tag value.
This increase and facilitate menu creation.

Check "History" for latest modifications (further in this page)


Download

Choose between binaries or sources distribution

Latest build : 2002 11 05

Tiles is also distributed with Struts 1.1 .
You can download it by downloading Struts.

Tiles, Components
and JSP Templates

Tiles was formely known as "Components". But as components means all and everything, we have choose to rename them to Tiles. 

Tiles provide a superset of Template tags as defined in Struts by David Geary : you can find all tags and behavior defined by Templates. But, Tiles  go one step beyond and extend the concept of "templates" to the concept of "parameterized components" or "Tiles".


Tiles and Struts

Tiles are actually shipped with Struts

Tiles and Struts code are clearly separated. In fact, Tiles can run without Struts. But using both give you interresting features, like forwarding an action to a tile's definition. Following is a list of actual modifications :

Tile Action Servlet
  • Add a "processForward" method.
  • Purpose : be able to subclass servlet, and override the forward mechanism.
  • Needed if you want to forward to a definition in struts-config.xml.
  • A ready to run servlet is provided.
text tag
  • Not mandatory, can be omitted if not used
  • Add a "prefix" attribute.
  • Purpose : be able to add a prefix to the name of generated input tag. This modification is not mandatory. It is only useful in some examples.

Give Your Feedback !

This library is a alive. Feel free to give your feedback on it !
If you have any idea to improve it, let me know !
Contact me at :
cedric@apache.org
or cedric.dumoulin@lifl.fr


History
03 Nov. 2002
  • Tiles now use the commons-logging package.
  • : Corrected a bug where the tag fail when reused by server.
  • The struts TilesPlugin now create one factory for each struts module
19 Jul. 2002
  • TilesPlugin available for Struts1.1
  • Blank war files have been updated
  • Definition factory interface has change. A new life cycle is introduce
  • Struts multi-modules feature works with the Tiles
20 Jun. 2002
  • Update DefinitionDispatcherAction. It now works again
13 Jun. 2002
  • Tiles configuration file now accept nested list as attribute
  • Add tag to DTD (submitted by Loren Halvorson)
  • configuration file
23 May 2002
  • tiles.XmlDefinition.XmlParser : enable default value for classtype attribute (org.apache.struts.tiles.beans.SimpleMenuItem). As a consequence, all classtype attribute can be removed in examples
  • tiles.XmlDefinition.I18nFactorySet : Enable serialization (bug reported by Dan Sykes)
14 Apr. 2002
  • tiles.XmlDefinition.XmlParser : Correct bug with new Digester release preventing config file lists to be correctly parsed
  • tabsLayout.jsp : Correct some syntax errors(bug reported by David Marshall)
  • taglib.tiles.UseAttribute : Add release of variable 'id' in release method (bug reported by Heath Chiavettone)
  • tiles.XmlDefinition.XmlDefinition : Add inheritance for controllerClass and controllerUrl attributes (bug reported by Jim Crossley)
  • tiles.XmlDefinition.I18nFactorySet : Add another loading method for config files in order to let Websphere 3.5.x run (patch from Stephen Houston)
  • tiles.ComponentActionServlet : Add overload of processForward and processInclude in order to catch properly forward in struts1.0.x struts-config (bug reported from struts user list)
22 Feb. 2002
  • Correct build process preventing examples compilation in war files
20 Feb. 2002
  • New tiles-blank-struts1.x applications
  • Change distribution (again) : back to the old fashion
18 Feb. 2002
  • New tiles-blank application
  • Added a TilesController to run with latest Struts 1.1 dev
  • Change distribution : a stable release build shipped with Struts1.0.x and a development release build with Struts1.1 dev
11 Jan. 2002
  • Corrected bug preventing empty <put> body tags in Tomcat4
  • Corrected customized factory loading. It now works again
   more ...


Copyright © 2000-2002, Apache Software Foundation
and Cedric Dumoulin