Tiles vs. JSP Include




 Advantage of Tiles over JSP include 
1. Code Repetition is reduced 
Use of Tiles reduce the code repetition to a great extent. Code repetition is bad but repetition of 
layout logic could be worst. Tiles also handle this issue. As you have layout templates based on 
which all the pages are combined, you don't need to repeat the code for layout. Other view 
components are also reusable and can be used in the same application at other places reducing 
the code repetition. 
2. Low coupling between pages 
Coupling is the degree of interactivity between two entities. It is always suggested to minimize 
coupling between unrelated classes, packages, and so on. Same principle is applied to view 
components. Tiles reduce the coupling between unrelated view components. 
3. High layout control 
Tiles provide great layout control by providing layout templates. 
4. I18N support for locale-specific loading 
5. Dynamic Page building 
Pages are built dynamically in tiles. You can control the page view by configuring it through 
xml. 
6. Elimination of duplicate and redundant information 
Tiles eliminate the duplicate and redundant information in the configuration file by providing 
Tiles inheritance.  
7. Central location for view components 
Tiles save definition of all the components at one place (in tilesDef.xml) and hence can be 
modified easily when required. 


 Disadvantages of Tiles 
1. Increases the number of pages 
2. Increases complexity 
Tiles increase complexity by introducing another layout page. Understanding and implementing 
templating can also be difficult at initial stages. 
3. Big API 
Tiles have a bigger API set which may be difficult to understand for getting full benefit of tiles. 
4. You have to specify a name to any component you create. 


Enter your email address to get our daily JOBS & INTERVIEW FAQ's Straight to your Inbox.

Make sure to activate your subscription by clicking on the activation link sent to your email