Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How are tiles different than include?

Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am a little confused as to why would somebody use tiles over include when working with Struts? What does Tile offer that a simple include doesnt?

Any help is appreciated.

M Hasan.
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you know more about includes than I do. Say you had 50 different pages and each page shared the same basic layout...a banner across the top, a navigation bar on the left side and another bar of links across the bottom of the page. Just using includes, wouldn't you have to have 50 different jsp pages that each included the three common areas? With tiles you have one layout page and you use tiles to define the main content area. Then if you wanted to move the navigation bar from the left to the right you just have one file to change instead of 50.

- Brent
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tiles is a framework which uses includes internally to do the job. You can create your own as well to achieve this but then it would be like writing a framework similar to struts to do the job.
Moreover tiles does provide a centralized configuration "tiles-def.xml" using which you can organize the layouts and various tiles.
Tiles can extend each other.
You can dynamically control the tile whether to be shown or hidden. The controller classes which are the callbacks before your tile gets rendered are used in doing so.
Maybe there are more than these advantages which tiles can provide instead of homegrown JSP includes. I tried to put over here whatever I know from my experience with tiles framework.
Without subsidies, chem-ag food costs four times more than organic. Or this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic