Chapter 20. Layout Management with Tiles

This chapter introduces the Tiles framework and illustrates how it can provide structure and flexibility in presenting an interface to customers of your Web site. The chapter also demonstrates how to integrate Tiles with the Struts framework discussed in the last chapter.

This chapter covers the following topics:

  • An introduction to Tiles

  • Installing Tiles for use in a Web application

  • Tiles definitions

  • Tiles tags

  • Advanced Tiles usage with parameters and inheritance

  • The use of Tiles with Struts

Introduction to Tiles

Web developers have an awful habit of forgetting one of the most important concepts of software development: reuse. Why do something twice when you can do it once and use it everywhere? It has been said that some of the best software developers are essentially lazy souls who are always trying to ensure that they develop something only once, designing it flexibly enough so that it, whatever it is, can be used everywhere. Many of the techniques and tools explained in this book are created with this goal in mind. The Tiles framework is no different.

Tiles was first developed as a simple templating framework called Components by Cedric Dumoulin, and has since been renamed to Tiles to avoid the confusion that could result from using that word. Today, Tiles has been completely integrated into the Struts framework, although it can still be used independently.

What is the Tiles framework?

Pages that are displayed on Web sites often contain areas that ...

Get Beginning JavaServer Pages™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.