Enhancing reusability through Apache Tiles
In the past, we developed a series of web pages (views), such as a page to show products, another page to add products, and so on, as part of our webstore application; though every view serves a different purpose, all of them share a common visual pattern, for example, each page has a header, content area, and so on. We have hardcoded and repeated those common elements in every JSP view page. This is not a good idea because in future, if we want to change the look and feel of any of these common elements, we will have to change every page in order to maintain a consistent look and feel across all the web pages.
To address this problem, modern web applications use template mechanisms; Apache Tiles is one such template composition framework. Tiles allow developers to define reusable page fragments (tiles) that can be assembled into a complete web page at runtime. These fragments can have parameters to allow dynamic content. This increases the reusability...