Reusing Layouts
Suppose we want to present multiple books as in this
library application.
We would like to not have to replicate the layout code for both pages.
- Suppose there were 6000 titles in the library and the same footer had to
be added to each!
We can encapsulate the layout code for reuse using Apache Tiles.
A tile is just an imported JSP page with these additional features:
- Can be nested
- Can be extended
- Can restrict them to users of a particular role
- Can attach controllers (Java objects) that are invoked just before tile
is displayed.