# Using Spring and Tiles-3 to Organize a Web Application's View Layer

DevFeed: [Using Spring and Tiles-3 to Organize a Web Application's View Layer](<https://devfeed.tech/articles/the-ultimate-view-tiles-3-31968.md>)

Original publisher: [Read original article](<https://tech.finn.no2012/07/25/the-ultimate-view-tiles-3/>)

Author: mick

Published: 2012-07-25T13:48:52Z

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>), [web applications](<https://devfeed.tech/topics/web-applications.md>), [Web](<https://devfeed.tech/topics/web.md>), [XML](<https://devfeed.tech/topics/xml.md>), [structure](<https://devfeed.tech/topics/structure.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [code](<https://devfeed.tech/tags/code.md>), [design](<https://devfeed.tech/tags/design.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>), [structure](<https://devfeed.tech/tags/structure.md>), [web](<https://devfeed.tech/tags/web.md>), [xml](<https://devfeed.tech/tags/xml.md>)

## AI overview

This tutorial explains how to organize a web application's view layer with Spring and Tiles-3. It presents four steps based on the Composite pattern and Convention over Configuration, and contrasts Apache Tiles with SiteMesh's design and performance limitations.

## Source excerpt

A story of getting the View layer up and running quickly in Spring... Since the original article, parts of the code has been accepted upstream, now available as part of the Tiles-3 release, so the article has been updated -- it's all even simpler! Based upon the Composite pattern and Convention over Configuration we'll pump steroids into a web application's view layer with four simple steps using Spring and Tiles-3 to make organising large complex websites elegant with minimal of xml editing. Contents of article... - 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. The architectural team had decided on Spring-Web as a framework for the control layer due to its flexibility and for providing us a 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 definitely less xml editing. But sitemesh has some serious shortcomings... SiteMesh shortcomings: from a design perspective the Decorator pattern can undermine the seperation MVC intends, requires 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 all the potentially included fragments, does not guaranteed thread safety, and 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 Composite Pattern, but within that allows one to take advantage of the Decorator pattern using a ViewPreparer. This meant it provided by default what we considered a superior design but if necessary