Help coderanch get a
new server
by contributing to the fundraiser
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Struts Templates vs. Tiles

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Struts 1.1 for a current web project. To further break down the View into reusable, manageable pieces I am using Struts Templates, which I have found that I like a lot. Recently, I read a little bit about Struts-Tiles, which appears to perform the same thing as Struts-Templates. Which is the preferred approach, or is it just a matter of personal preference? Is this covered in the Author's new book?
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Struts In Action has pretty good coverage of Tiles. I believe it was a full chapter, but I don't have the book in front of me right now.
 
Michael McElwee
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does it compare/contrast Tiles with Templates? I guess my concern is that I have already completed a fair amount of my project using Templates, so switching to Tiles could involve significant work. I am not opposed to that if there is some large benefit. Right now, they (Templates and Tiles) sound to me like different, equally-acceptable solutions. I have gotten decent with Struts, but I definitely do not consider myself an expert on this.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Michael,
Struts Tiles is a newer and more comprehensive approach to add Layout Management functionalities to Struts. It includes all the Struts Template tags.
To switch from Struts Templates to Struts Tiles all you have to do is to change the *.tld like this:

There is no need to change the prefix from templates to tiles.
Besides that the Tiles Framework goes much further: With 'Tiles Definitions' you can configure the whole Layout-Management with a XML file. You can catch the whole Screenflow of your project by just taking a glimpse in this XML file. You can even define and extend Tiles Definitions. It's fun and worth to give a try.
Regards
Berny Woehrlin
 
Author
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Bernie pointed out, Tiles is specifically designed to be backwardly-compatible with the Template library, so you should not have any trouble migrating.
Also, the Template library will be deprecated in the next iteration of Struts 1.1, if that counts for anything.
HTH, Ted.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic