O'Reilly logo

Programming Jakarta Struts, Second Edition by Chuck Cavaness

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Installing and Configuring Tiles

Before you can use the Tiles framework, you must ensure that it’s installed and properly configured within your web container. The Tiles framework is not dependent on any specific container. You will need to obtain the required files and ensure that they are placed into their proper directories within the web application.

Downloading Tiles

The Tiles framework is included with the Struts distribution. It previously was included in the contrib folder, but it is now part of the core distribution. You also can find the latest source and binary distribution, as well as other useful information, at http://www.lifl.fr/~dumoulin/tiles/index.html.

Installing the Required JARs and Misc Files

With earlier versions of Struts and Tiles, each was contained within its own JAR file. With Struts 1.1, Tiles components have now been integrated into struts.jar. As with all other things Struts, you will also need the standard commons JAR files installed in the WEB-INF/lib directory.

You will also need to install the Tiles TLD file, struts-tiles.tld, in the WEB-INF directory for the application.

Warning

Don’t add the struts.jar file to the classpath of your servlet container in an attempt to avoid placing it in the WEB-INF/lib directory of each individual web application. Doing so may cause ClassNotFoundExceptions to be thrown.

You should put the tiles-config_1_1.dtd file in the WEB-INF directory, too. This DTD is used to validate Tiles definition files, which we’ll discuss ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required