# Using Apache Tiles with Spring for View-Layer Composition

DevFeed: [Using Apache Tiles with Spring for View-Layer Composition](<https://devfeed.tech/articles/the-ultimate-view-31943.md>)

Original publisher: [Read original article](<https://tech.finn.no2010/11/04/the-ultimate-view/>)

Author: mick

Published: 2010-11-04T18:11:57Z

Content type: tutorial

Language: en

Sources: [Finn.no](<https://devfeed.tech/sources/finn-no.md>)

Topics: [Framework](<https://devfeed.tech/topics/framework.md>), [Front end](<https://devfeed.tech/topics/frontend.md>), [mvc](<https://devfeed.tech/topics/mvc.md>), [XML](<https://devfeed.tech/topics/xml.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [framework](<https://devfeed.tech/tags/framework.md>), [front-end](<https://devfeed.tech/tags/front-end.md>), [html](<https://devfeed.tech/tags/html.md>), [mvc](<https://devfeed.tech/tags/mvc.md>)

## AI overview

This tutorial describes integrating Apache Tiles with Spring to build a view layer using wildcards, fallback patterns, and definition includes. It contrasts Tiles with SiteMesh and discusses the Composite pattern, MVC, and reducing ongoing XML changes.

## Source excerpt

This article has been rewritten for Tiles-3. tech.finn.no/the-ultimate-view-tiles-3/ A story of getting the View layer up and running quickly in Spring, using Tiles with wildcards, fallbacks, and definition includes, to use the Composite pattern and Convention over Configuration providing a minimal ongoing xml changes. Summary From the architect's perspective you see Apache Tiles as rare exotic Italian marble sheets laid out exquisitely, while the same architect will see SiteMesh as the steel wiring stuck inside the concrete slab. The beauty of the tiles is always admired and a key component in creating an eye-catching surrounding. Summary Background Step 0: Spring to Tiles Integration Step 1: Wildcards Step 2: The fallback pattern Step 3: Definition includes When the Composite pattern is superior Conclusion Background At FINN.no we were redesigning our control and view layers. We, being the architectural team of six, had already decided on Spring-Web as a framework for the control layer due to its flexibility and a design for us providing better, simpler, migration path. For the front end we were a little unclear. In a department of ~60 developers we knew that the popular vote would lead us towards SiteMesh. And we knew why for practical purposes sitemesh gives the front end developer more flexibility and less xml editing. But we knew sitemesh has some serious shortcomings... SiteMesh shortcomings: from a design perspective the Decorator pattern doesn't combine with MVC as elegantly as the Composite pattern does requires to hold all possible html for a request in buffer requiring large amounts of memory unable to flush the response before the response is complete requires more overall processing due to the processing of all the potentially included fragments does not guaranteed thread safety does not provide any structure or organisation amongst jsps, making refactorings and other tricks awkward One of the alternatives we looked at was Apache Tiles. It follows the Co