File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Templates vs. Tiles

 
Michael McElwee
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • 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
 
Ted Husted
Author
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic